json-logger-service
Advanced tools
Comparing version 1.0.7 to 1.0.8
@@ -47,6 +47,6 @@ "use strict"; | ||
it('Should log debug', () => { | ||
jsonLoggerService.debug({ a: 'CONTEXT' }, 'It works!'); | ||
jsonLoggerService.debug('It works!', 'CONTEXT'); | ||
}); | ||
it('Should log warn', () => { | ||
jsonLoggerService.warn({ a: 'CONTEXT' }, 'It works!'); | ||
jsonLoggerService.warn('It works!', 'CONTEXT'); | ||
}); | ||
@@ -53,0 +53,0 @@ it('Should log verbose', () => { |
@@ -33,5 +33,7 @@ "use strict"; | ||
getBunyanParams(message, context) { | ||
const contextObj = (typeof context) === 'object' ? context : { context }; | ||
return { | ||
context: message === undefined ? | ||
this.getDefaultContextObject() : Object.assign(this.getDefaultContextObject(), context), | ||
this.getDefaultContextObject() | ||
: Object.assign(this.getDefaultContextObject(), contextObj), | ||
message: message === undefined ? context : message, | ||
@@ -38,0 +40,0 @@ }; |
@@ -6,7 +6,7 @@ import { LoggerService } from '@nestjs/common'; | ||
constructor(name: string, customContextBuilder?: CustomContextBuilderInterface); | ||
log(context: any, message?: string): any; | ||
error(context: any, trace?: string, message?: string): any; | ||
warn(context: any, message?: string): any; | ||
debug?(context: any, message?: string): any; | ||
verbose?(context: any, message?: string): any; | ||
log(message: any, context?: string): any; | ||
error(message: any, trace?: string, context?: string): any; | ||
warn(message: any, context?: string): any; | ||
debug?(message: any, context?: string): any; | ||
verbose?(message: any, context?: string): any; | ||
} |
@@ -8,15 +8,15 @@ "use strict"; | ||
} | ||
log(context, message) { | ||
log(message, context) { | ||
return this.logger.info(context, message); | ||
} | ||
error(context, trace, message) { | ||
error(message, trace, context) { | ||
return this.logger.error(context, trace, message); | ||
} | ||
warn(context, message) { | ||
warn(message, context) { | ||
return this.logger.warn(context, message); | ||
} | ||
debug(context, message) { | ||
debug(message, context) { | ||
return this.logger.debug(context, message); | ||
} | ||
verbose(context, message) { | ||
verbose(message, context) { | ||
return this.logger.trace(context, message); | ||
@@ -23,0 +23,0 @@ } |
{ | ||
"name": "json-logger-service", | ||
"version": "1.0.7", | ||
"version": "1.0.8", | ||
"description": "Nest Json LoggerService implementation.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
19287
224