pino-pretty
Advanced tools
Comparing version 4.0.1 to 4.0.2
@@ -77,3 +77,2 @@ 'use strict' | ||
const prettifiedMessage = prettifyMessage({ log, messageKey, colorizer, messageFormat }) | ||
const prettifiedTime = prettifyTime({ log, translateFormat: opts.translateTime, timestampKey }) | ||
@@ -91,2 +90,3 @@ if (ignoreKeys) { | ||
const prettifiedMetadata = prettifyMetadata({ log }) | ||
const prettifiedTime = prettifyTime({ log, translateFormat: opts.translateTime, timestampKey }) | ||
@@ -93,0 +93,0 @@ let line = '' |
{ | ||
"name": "pino-pretty", | ||
"version": "4.0.1", | ||
"version": "4.0.2", | ||
"description": "Prettifier for Pino log lines", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -617,2 +617,9 @@ 'use strict' | ||
t.test('ignores time', (t) => { | ||
t.plan(1) | ||
const pretty = prettyFactory({ ignore: 'time' }) | ||
const arst = pretty(`{"msg":"hello world", "pid":"${pid}", "hostname":"${hostname}", "time":${epoch}, "level":30, "v":1}`) | ||
t.is(arst, `INFO (${pid} on ${hostname}): hello world\n`) | ||
}) | ||
t.test('prettifies trace caller', (t) => { | ||
@@ -647,17 +654,3 @@ t.plan(1) | ||
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 @timestamp: ${epoch}\n`) | ||
}) | ||
t.test('handles using ignored timestampKey', (t) => { | ||
t.plan(1) | ||
const pretty = prettyFactory({ timestampKey: '@timestamp', ignore: '@timestamp' }) | ||
const arst = pretty(`{"msg":"hello world", "@timestamp":${epoch}, "level":30}`) | ||
t.is(arst, `[${epoch}] INFO : hello world\n`) | ||
}) | ||
t.end() | ||
}) |
@@ -103,29 +103,3 @@ '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 @timestamp: 1522431328992\n') | ||
}) | ||
const logLine = '{"level":30,"@timestamp":1522431328992,"msg":"hello world"}\n' | ||
child.stdin.write(logLine) | ||
t.tearDown(() => child.kill()) | ||
}) | ||
t.test('uses an ignored timestampKey', (t) => { | ||
t.plan(1) | ||
const env = { TERM: 'dumb' } | ||
const child = spawn(process.argv[0], [bin, '--timestampKey', '@timestamp', '--ignore', '@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
267093
2161