Comparing version 3.0.7 to 3.1.0
{ | ||
"name": "pino", | ||
"version": "3.0.7", | ||
"version": "3.1.0", | ||
"description": "super fast, all natural json logger", | ||
@@ -45,2 +45,6 @@ "main": "pino.js", | ||
"author": "Matteo Collina <hello@matteocollina.com>", | ||
"contributors": [ | ||
"David Mark Clements <huperekchuno@googlemail.com>", | ||
"James Sumners <james.sumners@gmail.com>" | ||
], | ||
"license": "MIT", | ||
@@ -47,0 +51,0 @@ "bugs": { |
24
pino.js
@@ -160,3 +160,2 @@ 'use strict' | ||
this._setLevel(opts.level) | ||
this._baseLog = flatstr(baseLog + | ||
@@ -245,10 +244,9 @@ (this.name === undefined ? '' : '"name":' + this.stringify(this.name) + ',')) | ||
data += ',"type":"Error","stack":' + this.stringify(obj.stack) | ||
} else { | ||
for (var key in obj) { | ||
value = obj[key] | ||
if (obj.hasOwnProperty(key) && value !== undefined) { | ||
value = this.stringify(this.serializers[key] ? this.serializers[key](value) : value) | ||
if (value !== undefined) { | ||
data += ',"' + key + '":' + value | ||
} | ||
} | ||
for (var key in obj) { | ||
value = obj[key] | ||
if (obj.hasOwnProperty(key) && value !== undefined) { | ||
value = this.stringify(this.serializers[key] ? this.serializers[key](value) : value) | ||
if (value !== undefined) { | ||
data += ',"' + key + '":' + value | ||
} | ||
@@ -369,3 +367,3 @@ } | ||
function asErrValue (err) { | ||
return { | ||
var obj = { | ||
type: err.constructor.name, | ||
@@ -375,2 +373,8 @@ message: err.message, | ||
} | ||
for (var key in err) { | ||
if (obj[key] === undefined) { | ||
obj[key] = err[key] | ||
} | ||
} | ||
return obj | ||
} | ||
@@ -377,0 +381,0 @@ |
@@ -70,24 +70,2 @@ 'use strict' | ||
test('passing error at level ' + name, function (t) { | ||
t.plan(2) | ||
var err = new Error('myerror') | ||
var instance = pino(sink(function (chunk, enc, cb) { | ||
t.ok(new Date(chunk.time) <= new Date(), 'time is greater than Date.now()') | ||
delete chunk.time | ||
t.deepEqual(chunk, { | ||
pid: pid, | ||
hostname: hostname, | ||
level: level, | ||
type: 'Error', | ||
msg: err.message, | ||
stack: err.stack, | ||
v: 1 | ||
}) | ||
cb() | ||
})) | ||
instance.level = name | ||
instance[name](err) | ||
}) | ||
test('passing error with a serializer at level ' + name, function (t) { | ||
@@ -94,0 +72,0 @@ t.plan(2) |
Sorry, the diff of this file is not supported yet
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
100763
27
2249