pino-pretty
Advanced tools
Comparing version 4.0.2 to 4.0.3
@@ -136,3 +136,3 @@ 'use strict' | ||
} else { | ||
const skipKeys = [messageKey, levelKey].filter(key => typeof log[key] === 'string') | ||
const skipKeys = [messageKey, levelKey, timestampKey].filter(key => typeof log[key] === 'string' || typeof log[key] === 'number') | ||
const prettifiedObject = prettifyObject({ | ||
@@ -139,0 +139,0 @@ input: log, |
{ | ||
"name": "pino-pretty", | ||
"version": "4.0.2", | ||
"version": "4.0.3", | ||
"description": "Prettifier for Pino log lines", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -653,3 +653,10 @@ 'use strict' | ||
t.test('handles specified timestampKey', (t) => { | ||
t.plan(1) | ||
const pretty = prettyFactory({ timestampKey: '@timestamp' }) | ||
const arst = pretty(`{"msg":"hello world", "@timestamp":${epoch}, "level":30}`) | ||
t.is(arst, `[${epoch}] INFO : hello world\n`) | ||
}) | ||
t.end() | ||
}) |
@@ -103,3 +103,16 @@ 'use strict' | ||
t.test('uses specified timestampKey', (t) => { | ||
t.plan(1) | ||
const env = { TERM: 'dumb' } | ||
const child = spawn(process.argv[0], [bin, '--timestampKey', '@timestamp'], { env }) | ||
child.on('error', t.threw) | ||
child.stdout.on('data', (data) => { | ||
t.is(data.toString(), '[1522431328992] INFO : hello world\n') | ||
}) | ||
const logLine = '{"level":30,"@timestamp":1522431328992,"msg":"hello world"}\n' | ||
child.stdin.write(logLine) | ||
t.tearDown(() => child.kill()) | ||
}) | ||
t.end() | ||
}) |
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
267897
2179