@dazn/lambda-powertools-logger
Advanced tools
Comparing version 1.21.0 to 1.23.0
@@ -12,3 +12,6 @@ // These tests are put aside in a separate file because the presense of correlation IDs | ||
const consoleLog = jest.fn() | ||
global.console.log = consoleLog | ||
global.console.debug = consoleLog | ||
global.console.info = consoleLog | ||
global.console.warn = consoleLog | ||
global.console.error = consoleLog | ||
@@ -15,0 +18,0 @@ beforeEach(consoleLog.mockReset) |
@@ -10,3 +10,6 @@ process.env.AWS_REGION = 'us-east-1' | ||
const consoleLog = jest.fn() | ||
global.console.log = consoleLog | ||
global.console.debug = consoleLog | ||
global.console.info = consoleLog | ||
global.console.warn = consoleLog | ||
global.console.error = consoleLog | ||
@@ -13,0 +16,0 @@ beforeEach(consoleLog.mockClear) |
@@ -6,2 +6,13 @@ # Change Log | ||
# [1.23.0](https://github.com/getndazn/dazn-lambda-powertools/compare/v1.22.1...v1.23.0) (2020-04-06) | ||
### Features | ||
* **logger:** use the correct console logging methods ([036c00d](https://github.com/getndazn/dazn-lambda-powertools/commit/036c00d2ddb62374cd7546d55de78aca9319cfab)) | ||
# [1.21.0](https://github.com/getndazn/dazn-lambda-powertools/compare/v1.20.0...v1.21.0) (2020-02-09) | ||
@@ -8,0 +19,0 @@ |
@@ -74,4 +74,11 @@ const CorrelationIds = require('@dazn/lambda-powertools-correlation-ids') | ||
const consoleMethods = { | ||
DEBUG: console.debug, | ||
INFO: console.info, | ||
WARN: console.warn, | ||
ERROR: console.error | ||
} | ||
// re-order message and params to appear earlier in the log row | ||
console.log(JSON.stringify({ message, ...params, ...logMsg }, (key, value) => typeof value === 'bigint' | ||
consoleMethods[levelName](JSON.stringify({ message, ...params, ...logMsg }, (key, value) => typeof value === 'bigint' | ||
? value.toString() | ||
@@ -78,0 +85,0 @@ : value |
{ | ||
"name": "@dazn/lambda-powertools-logger", | ||
"version": "1.21.0", | ||
"version": "1.23.0", | ||
"description": "Logger that is tightly integrated with the rest of the lambda-powertools", | ||
@@ -13,3 +13,3 @@ "main": "index.js", | ||
"dependencies": { | ||
"@dazn/lambda-powertools-correlation-ids": "^1.8.2" | ||
"@dazn/lambda-powertools-correlation-ids": "^1.23.0" | ||
}, | ||
@@ -19,3 +19,3 @@ "publishConfig": { | ||
}, | ||
"gitHead": "07fd626eb4acedc59f99da85d24ab3811951a831" | ||
"gitHead": "7ff4efd09caa266d7256e858e609fe8cf84d0df2" | ||
} |
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
21282
345