nestjs-pino
Advanced tools
Comparing version 3.4.0 to 3.5.0
@@ -20,3 +20,3 @@ "use strict"; | ||
const PinoLogger_1 = require("./PinoLogger"); | ||
let Logger = exports.Logger = class Logger { | ||
let Logger = class Logger { | ||
constructor(logger, { renameContext }) { | ||
@@ -97,2 +97,3 @@ this.logger = logger; | ||
}; | ||
exports.Logger = Logger; | ||
exports.Logger = Logger = __decorate([ | ||
@@ -99,0 +100,0 @@ (0, common_1.Injectable)(), |
@@ -13,3 +13,3 @@ "use strict"; | ||
const rxjs_1 = require("rxjs"); | ||
let LoggerErrorInterceptor = exports.LoggerErrorInterceptor = class LoggerErrorInterceptor { | ||
let LoggerErrorInterceptor = class LoggerErrorInterceptor { | ||
intercept(context, next) { | ||
@@ -31,2 +31,3 @@ return next.handle().pipe((0, rxjs_1.catchError)((error) => { | ||
}; | ||
exports.LoggerErrorInterceptor = LoggerErrorInterceptor; | ||
exports.LoggerErrorInterceptor = LoggerErrorInterceptor = __decorate([ | ||
@@ -33,0 +34,0 @@ (0, common_1.Injectable)() |
@@ -26,3 +26,3 @@ "use strict"; | ||
const DEFAULT_ROUTES = [{ path: '*', method: common_1.RequestMethod.ALL }]; | ||
let LoggerModule = exports.LoggerModule = LoggerModule_1 = class LoggerModule { | ||
let LoggerModule = LoggerModule_1 = class LoggerModule { | ||
static forRoot(params) { | ||
@@ -78,2 +78,3 @@ const paramsProvider = { | ||
}; | ||
exports.LoggerModule = LoggerModule; | ||
exports.LoggerModule = LoggerModule = LoggerModule_1 = __decorate([ | ||
@@ -80,0 +81,0 @@ (0, common_1.Global)(), |
{ | ||
"name": "nestjs-pino", | ||
"version": "3.4.0", | ||
"version": "3.5.0", | ||
"description": "Pino logger for NestJS", | ||
@@ -60,3 +60,3 @@ "main": "index.js", | ||
"eslint-plugin-prettier": "^5.0.0", | ||
"jest": "29.6.2", | ||
"jest": "29.7.0", | ||
"memorystream": "^0.3.1", | ||
@@ -63,0 +63,0 @@ "pino": "^8.15.0", |
@@ -28,2 +28,3 @@ import pino from 'pino'; | ||
protected readonly contextName: string; | ||
protected readonly errorKey: string; | ||
constructor({ pinoHttp, renameContext }: Params); | ||
@@ -30,0 +31,0 @@ get logger(): pino.Logger; |
@@ -31,5 +31,12 @@ "use strict"; | ||
exports.__resetOutOfContextForTests = __resetOutOfContextForTests; | ||
let PinoLogger = exports.PinoLogger = PinoLogger_1 = class PinoLogger { | ||
let PinoLogger = PinoLogger_1 = class PinoLogger { | ||
constructor({ pinoHttp, renameContext }) { | ||
var _a; | ||
this.context = ''; | ||
this.errorKey = 'err'; | ||
if (typeof pinoHttp === 'object' && | ||
'customAttributeKeys' in pinoHttp && | ||
typeof pinoHttp.customAttributeKeys !== 'undefined') { | ||
this.errorKey = (_a = pinoHttp.customAttributeKeys.err) !== null && _a !== void 0 ? _a : 'err'; | ||
} | ||
if (!outOfContext) { | ||
@@ -93,3 +100,3 @@ if (Array.isArray(pinoHttp)) { | ||
args = [ | ||
Object.assign({ [this.contextName]: this.context }, { err: firstArg }), | ||
Object.assign({ [this.contextName]: this.context }, { [this.errorKey]: firstArg }), | ||
...args.slice(1), | ||
@@ -114,2 +121,3 @@ ]; | ||
}; | ||
exports.PinoLogger = PinoLogger; | ||
exports.PinoLogger = PinoLogger = PinoLogger_1 = __decorate([ | ||
@@ -116,0 +124,0 @@ (0, common_1.Injectable)({ scope: common_1.Scope.TRANSIENT }), |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
57424
612