+1
-1
| { | ||
| "name": "pino", | ||
| "version": "2.6.1", | ||
| "version": "2.7.0", | ||
| "description": "fast and simple logger", | ||
@@ -5,0 +5,0 @@ "main": "pino.js", |
+5
-7
@@ -11,2 +11,3 @@ 'use strict' | ||
| var hostname = os.hostname() | ||
| var baseLog = flatstr('{"pid":' + pid + ',"hostname":"' + hostname + '",') | ||
@@ -65,3 +66,3 @@ var LOG_VERSION = 1 | ||
| var logger = new Pino(level, stream, serializers, stringify, end, name, hostname, slowtime, '', cache, formatOpts) | ||
| var logger = new Pino(level, stream, serializers, stringify, end, name, slowtime, '', cache, formatOpts) | ||
| if (cache) { | ||
@@ -100,3 +101,3 @@ onExit(function (code, evt) { | ||
| function Pino (level, stream, serializers, stringify, end, name, hostname, slowtime, chindings, cache, formatOpts) { | ||
| function Pino (level, stream, serializers, stringify, end, name, slowtime, chindings, cache, formatOpts) { | ||
| this.stream = stream | ||
@@ -107,3 +108,2 @@ this.serializers = serializers | ||
| this.name = name | ||
| this.hostname = hostname | ||
| this.slowtime = slowtime | ||
@@ -200,4 +200,3 @@ this.chindings = chindings | ||
| Pino.prototype.message = function message (level, msg) { | ||
| return '{"pid":' + pid + ',' + | ||
| (this.hostname === undefined ? '' : '"hostname":"' + this.hostname + '",') + | ||
| return baseLog + | ||
| (this.name === undefined ? '' : '"name":"' + this.name + '",') + | ||
@@ -233,3 +232,2 @@ '"level":' + level + ',' + | ||
| this.name, | ||
| this.hostname, | ||
| this.slowtime, | ||
@@ -244,3 +242,3 @@ data, | ||
| if (!this.cache) { | ||
| this.stream.write(s) | ||
| this.stream.write(flatstr(s)) | ||
| return | ||
@@ -247,0 +245,0 @@ } |
+34
-25
@@ -80,9 +80,9 @@ # pino [](https://travis-ci.org/mcollina/pino) [](https://coveralls.io/github/mcollina/pino?branch=master) | ||
| ``` | ||
| benchBunyan*10000: 1752.137ms | ||
| benchWinston*10000: 2642.697ms | ||
| benchBole*10000: 349.301ms | ||
| benchDebug*10000: 621.877ms | ||
| benchLogLevel*10000: 392.642ms | ||
| benchPino*10000: 365.075ms | ||
| benchPinoExreme*10000: 112.848ms | ||
| benchBunyan*10000: 1355.229ms | ||
| benchWinston*10000: 2226.117ms | ||
| benchBole*10000: 291.727ms | ||
| benchDebug*10000: 445.291ms | ||
| benchLogLevel*10000: 322.181ms | ||
| benchPino*10000: 269.109ms | ||
| benchPinoExreme*10000: 102.239ms | ||
| ``` | ||
@@ -93,14 +93,23 @@ | ||
| ``` | ||
| benchBunyanObj*10000: 1717.269ms | ||
| benchWinstonObj*10000: 2409.900ms | ||
| benchBoleObj*10000: 364.634ms | ||
| benchLogLevelObject*10000: 1641.296ms | ||
| benchPinoObj*10000: 385.967ms | ||
| benchPinoUnsafeObj*10000: 383.686ms | ||
| benchPinoExtremeObj*10000: 171.360ms | ||
| benchPinoUnsafeExtremeObj*10000: 165.241ms | ||
| benchBunyanObj*10000: 1464.568ms | ||
| benchWinstonObj*10000: 2177.602ms | ||
| benchBoleObj*10000: 322.105ms | ||
| benchLogLevelObject*10000: 1443.148ms | ||
| benchPinoObj*10000: 309.564ms | ||
| benchPinoUnsafeObj*10000: 301.308ms | ||
| benchPinoExtremeObj*10000: 130.343ms | ||
| benchPinoUnsafeExtremeObj*10000: 131.322ms | ||
| ``` | ||
| `pino.info(aBigDeeplyNestedObject)`: | ||
| ``` | ||
| benchBunyanDeepObj*10000: 8749.174ms | ||
| benchWinstonDeepObj*10000: 17761.409ms | ||
| benchBoleDeepObj*10000: 5252.563ms | ||
| benchLogLevelDeepObj*10000: 43518.525ms | ||
| benchPinoDeepObj*10000: 5124.361ms | ||
| benchPinoUnsafeDeepObj*10000: 3539.253ms | ||
| benchPinoExtremeDeepObj*10000: 5138.457ms | ||
| benchPinoUnsafeExtremeDeepObj*10000: 3480.270ms | ||
| ``` | ||
@@ -111,14 +120,14 @@ | ||
| ``` | ||
| benchDebugInterpolateExtra*10000: 946.580ms | ||
| benchBunyanInterpolateExtra*10000: 3663.827ms | ||
| benchWinstonInterpolateExtra*10000: 3339.332ms | ||
| benchBoleInterpolateExtra*10000: 2004.084ms | ||
| benchLogLevelInterpolateExtra*10000: 2150.711ms | ||
| benchPinoInterpolateExtra*10000: 706.112ms | ||
| benchPinoUnsafeInterpolateExtra*10000: 674.391ms | ||
| benchPinoExtremeInterpolateExtra*10000: 359.784ms | ||
| benchPinoUnsafeExtremeInterpolateExtra*10000: 346.463ms | ||
| benchDebugInterpolateExtra*10000: 640.001ms | ||
| benchBunyanInterpolateExtra*10000: 2888.825ms | ||
| benchWinstonInterpolateExtra*10000: 2616.285ms | ||
| benchBoleInterpolateExtra*10000: 1313.470ms | ||
| benchLogLevelInterpolateExtra*10000: 1487.610ms | ||
| benchPinoInterpolateExtra*10000: 486.367ms | ||
| benchPinoUnsafeInterpolateExtra*10000: 457.778ms | ||
| benchPinoExtremeInterpolateExtra*10000: 314.635ms | ||
| benchPinoUnsafeExtremeInterpolateExtra*10000: 294.915ms | ||
| ``` | ||
| In multiple cases, pino is over 6x faster than alternatives. | ||
| In many cases, pino is over 6x faster than alternatives. | ||
@@ -125,0 +134,0 @@ For a fair comparison, [LogLevel](http://npm.im/loglevel) was extended |
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Debug access
Supply chain riskUses debug, reflection and dynamic code execution features.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Debug access
Supply chain riskUses debug, reflection and dynamic code execution features.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
481165
0.05%832
1.09%1970
-0.1%