New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

nestjs-pino

Package Overview
Dependencies
Maintainers
1
Versions
1336
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nestjs-pino - npm Package Compare versions

Comparing version 1.1.3 to 1.2.0

2

dist/index.d.ts

@@ -5,2 +5,2 @@ export { LoggerModule } from "./LoggerModule";

export { PinoLogger } from "./PinoLogger";
export { InjectPinoLogger } from "./InjectPinoLogger";
export { InjectPinoLogger, getLoggerToken } from "./InjectPinoLogger";

@@ -11,2 +11,3 @@ "use strict";

exports.InjectPinoLogger = InjectPinoLogger_1.InjectPinoLogger;
exports.getLoggerToken = InjectPinoLogger_1.getLoggerToken;
//# sourceMappingURL=index.js.map
import { Provider } from "@nestjs/common";
import { PinoLogger } from "./PinoLogger";
export declare function InjectPinoLogger(context?: string): (target: Object, key: string | symbol, index?: number | undefined) => void;
export declare function InjectPinoLogger(context?: string): (target: object, key: string | symbol, index?: number | undefined) => void;
export declare function createProvidersForDecorated(): Array<Provider<PinoLogger>>;
export declare function getLoggerToken(context: string): string;

@@ -9,3 +9,3 @@ "use strict";

decoratedLoggers.add(context);
return common_1.Inject(`${decoratedTokenPrefix}${context}`);
return common_1.Inject(getLoggerToken(context));
}

@@ -15,3 +15,3 @@ exports.InjectPinoLogger = InjectPinoLogger;

return {
provide: `${decoratedTokenPrefix}${context}`,
provide: getLoggerToken(context),
useFactory: (logger) => {

@@ -28,2 +28,6 @@ logger.setContext(context);

exports.createProvidersForDecorated = createProvidersForDecorated;
function getLoggerToken(context) {
return `${decoratedTokenPrefix}${context}`;
}
exports.getLoggerToken = getLoggerToken;
//# sourceMappingURL=InjectPinoLogger.js.map
{
"name": "nestjs-pino",
"version": "1.1.3",
"version": "1.2.0",
"description": "Pino logger for NestJS",

@@ -34,5 +34,5 @@ "main": "dist/index.js",

"dependencies": {
"@types/pino-http": "^4.3.2",
"@types/pino-http": "^5.0.0",
"express-ctx": "^0.1.1",
"pino-http": "^4.3.0"
"pino-http": "^5.0.0"
},

@@ -42,7 +42,7 @@ "devDependencies": {

"@nestjs/core": "^6.6.7",
"@nestjs/platform-express": "^6.6.7",
"@nestjs/platform-fastify": "^6.7.2",
"@nestjs/platform-express": "^7.0.0",
"@nestjs/platform-fastify": "^7.0.0",
"@nestjs/testing": "^6.6.7",
"@types/express": "^4.17.1",
"@types/jest": "^24.0.18",
"@types/jest": "^25.1.0",
"@types/memorystream": "^0.3.0",

@@ -53,3 +53,3 @@ "@types/node": "^13.1.0",

"express": "^4.17.1",
"jest": "^24.9.0",
"jest": "^25.1.0",
"memorystream": "^0.3.1",

@@ -59,4 +59,4 @@ "reflect-metadata": "^0.1.13",

"supertest": "^4.0.2",
"ts-jest": "^24.0.2",
"tslint": "^5.19.0",
"ts-jest": "^25.0.0",
"tslint": "^6.0.0",
"typescript": "^3.6.2"

@@ -63,0 +63,0 @@ },

@@ -411,2 +411,19 @@ <p align="center">

#### Testing a class that uses @InjectPinoLogger
This package exposes a getLoggerToken() function that returns a prepared injection token based on the provided context.
Using this token, you can easily provide a mock implementation of the logger using any of the standard custom provider techniques, including useClass, useValue, and useFactory.
```ts
const module: TestingModule = await Test.createTestingModule({
providers: [
MyService,
{
provide: getLoggerToken(MyService.name),
useValue: mockLogger,
},
],
}).compile();
```
## Usage as NestJS app logger

@@ -413,0 +430,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc