Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

pino

Package Overview
Dependencies
Maintainers
3
Versions
311
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pino - npm Package Compare versions

Comparing version 3.0.7 to 3.1.0

test/error.test.js

6

package.json
{
"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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc