pino-colada
Advanced tools
Comparing version 2.0.1 to 2.1.0
12
index.js
@@ -26,3 +26,3 @@ var prettyBytes = require('prettier-bytes') | ||
function isPinoLog (log) { | ||
return log && (log.hasOwnProperty('level')) | ||
return log && (Object.prototype.hasOwnProperty.call(log, 'level')) | ||
} | ||
@@ -88,2 +88,7 @@ | ||
: null | ||
// Output err if it has more keys than 'stack' | ||
var err = (obj.level === 'fatal' || obj.level === 'error') && | ||
obj.err && Object.keys(obj.err).find(key => key !== 'stack') | ||
? obj.err | ||
: null | ||
@@ -98,2 +103,3 @@ if (method != null) { | ||
if (stack != null) output.push(formatStack(stack)) | ||
if (err != null) output.push(formatErrorProp(err)) | ||
@@ -173,2 +179,6 @@ return output.filter(noEmpty).join(' ') | ||
function formatErrorProp (errorPropValue) { | ||
return nl + JSON.stringify({ err: errorPropValue }, null, 2) | ||
} | ||
function noEmpty (val) { | ||
@@ -175,0 +185,0 @@ return !!val |
{ | ||
"name": "pino-colada", | ||
"version": "2.0.1", | ||
"version": "2.1.0", | ||
"description": "cute ndjson logger for pino", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
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
57502
227