Comparing version 0.3.0 to 0.3.1
{ | ||
"name": "pino", | ||
"version": "0.3.0", | ||
"version": "0.3.1", | ||
"description": "fast and simple logger", | ||
@@ -5,0 +5,0 @@ "main": "pino.js", |
15
pino.js
'use strict' | ||
var stringifySafe = require('json-stringify-safe') | ||
var format = require('util').format // eslint-disable-line no-unused-vars | ||
var format = require('util').format | ||
var os = require('os') | ||
@@ -97,3 +97,3 @@ var pid = process.pid | ||
function asJson (obj, msg, num) { // eslint-disable-line no-unused-vars | ||
function asJson (obj, msg, num) { | ||
if (!msg && obj instanceof Error) { | ||
@@ -105,6 +105,4 @@ msg = obj.message | ||
if (obj) { | ||
data = data.slice(0, data.length - 1) | ||
if (obj instanceof Error) { | ||
data += ',"type":"Error","stack":' + stringify(obj.stack) + '}' | ||
data += ',"type":"Error","stack":' + stringify(obj.stack) | ||
} else { | ||
@@ -118,8 +116,9 @@ for (var key in obj) { | ||
} | ||
data += '}' | ||
} | ||
} | ||
return data + '\n' | ||
return data + '}\n' | ||
} | ||
// returns string json with final brace omitted | ||
// the final brace is added by asJson | ||
function message (level, msg) { | ||
@@ -132,3 +131,3 @@ return '{"pid":' + pid + ',' + | ||
'"time":"' + (new Date()).toISOString() + '",' + | ||
'"v":' + 0 + '}' | ||
'"v":' + 0 | ||
} | ||
@@ -135,0 +134,0 @@ } |
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
242210