pino-pretty
Advanced tools
Comparing version 2.2.3 to 2.2.4
@@ -224,5 +224,7 @@ 'use strict' | ||
if (errorLikeObjectKeys.indexOf(keys[i]) !== -1 && value[keys[i]] !== undefined) { | ||
const lines = JSON.stringify(value[keys[i]], null, 2) | ||
if (lines === undefined) continue | ||
const arrayOfLines = ( | ||
IDENT + keys[i] + ': ' + | ||
joinLinesWithIndentation(JSON.stringify(value[keys[i]], null, 2)) + | ||
joinLinesWithIndentation(lines) + | ||
EOL | ||
@@ -253,3 +255,6 @@ ).split('\n') | ||
if (value[keys[i]] !== undefined) { | ||
result += IDENT + keys[i] + ': ' + joinLinesWithIndentation(JSON.stringify(value[keys[i]], null, 2)) + EOL | ||
const lines = JSON.stringify(value[keys[i]], null, 2) | ||
if (lines !== undefined) { | ||
result += IDENT + keys[i] + ': ' + joinLinesWithIndentation(lines) + EOL | ||
} | ||
} | ||
@@ -256,0 +261,0 @@ } |
{ | ||
"name": "pino-pretty", | ||
"version": "2.2.3", | ||
"version": "2.2.4", | ||
"description": "Prettifier for Pino log lines", | ||
@@ -43,8 +43,8 @@ "main": "index.js", | ||
"devDependencies": { | ||
"pino": "^5.8.0", | ||
"pino": "^5.8.1", | ||
"pre-commit": "^1.2.2", | ||
"snazzy": "^8.0.0", | ||
"standard": "^12.0.1", | ||
"tap": "^12.0.1" | ||
"tap": "^12.1.0" | ||
} | ||
} |
@@ -488,3 +488,28 @@ 'use strict' | ||
t.test('prettifies object with some undefined values', (t) => { | ||
t.plan(1) | ||
const dest = new Writable({ | ||
write (chunk, _, cb) { | ||
t.is( | ||
chunk + '', | ||
`[${epoch}] INFO (${pid} on ${hostname}): \n a: {\n "b": "c"\n }\n n: null\n` | ||
) | ||
cb() | ||
} | ||
}) | ||
const log = pino({ | ||
prettifier: prettyFactory, | ||
prettyPrint: true | ||
}, dest) | ||
log.info({ | ||
a: { b: 'c' }, | ||
s: Symbol.for('s'), | ||
f: f => f, | ||
c: class C {}, | ||
n: null, | ||
err: { toJSON () {} } | ||
}) | ||
}) | ||
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
219500
1026