Comparing version 4.7.1 to 4.7.2
@@ -28,2 +28,3 @@ # Table of Contents | ||
+ [.epochTime](#epochTimeFunction) | ||
+ [.unixTime](#unixTimeFunction) | ||
+ [.slowTime](#slowTimeFunction) | ||
@@ -45,3 +46,3 @@ + [.nullTime](#nullTimeFunction) | ||
of objects. These functions should return an JSONifiable object and they | ||
should never throw. When logging an object, each top-level property matching the exact key of a serializer | ||
should never throw. When logging an object, each top-level property matching the exact key of a serializer | ||
will be serialized using the defined serializer. | ||
@@ -152,3 +153,3 @@ * `timestamp` (boolean|function): Enables or disables the inclusion of a timestamp in the | ||
var log = require('pino')() | ||
if ('pino' in child) conosole.log(`pino version: ${log.pino}`) | ||
if ('pino' in child) console.log(`pino version: ${log.pino}`) | ||
``` | ||
@@ -572,2 +573,7 @@ | ||
<a id="unixTimeFunction"></a> | ||
### .unixTime | ||
Returns a unix time in seconds, like `,"time":1493426328`. | ||
<a id="slowTimeFunction"></a> | ||
@@ -574,0 +580,0 @@ ### .slowTime |
@@ -36,5 +36,7 @@ # Transports | ||
+ [pino-elasticsearch](#pino-elasticsearch) | ||
+ [pino-mq](#pino-mq) | ||
+ [pino-socket](#pino-socket) | ||
+ [pino-syslog](#pino-syslog) | ||
<a id="pino-couch"></a> | ||
@@ -86,2 +88,25 @@ ### pino-couch | ||
<a id="pino-mq"></a> | ||
### pino-mq | ||
pino-mq will take all messages received on process.stdin and send them over a message bus using JSON serialization; this is more a transform for pino messages because you will need some processing on the other end of the queue(s) to process message and store them in a backend; it is useful for : | ||
* moving your backpressure from your application to broker | ||
* transforming messages pressure to another component | ||
``` | ||
node app.js | pino-mq -u "amqp://guest:guest@localhost/" -q "pino-logs" | ||
``` | ||
or (recomended) | ||
``` | ||
node app.js | pino-mq -c pino-mq.json | ||
``` | ||
you can get a sample of configuration file by running: | ||
``` | ||
pino-mq -g | ||
``` | ||
for full documentation of command line switches and pino-mq.json read [readme](https://github.com/itavy/pino-mq#readme) | ||
<a id="pino-socket"></a> | ||
@@ -88,0 +113,0 @@ ### pino-socket |
@@ -11,2 +11,6 @@ 'use strict' | ||
function unixTime () { | ||
return ',"time":' + Math.round(Date.now() / 1000.0) | ||
} | ||
function slowTime () { | ||
@@ -19,3 +23,4 @@ return ',"time":"' + (new Date()).toISOString() + '"' | ||
epochTime: epochTime, | ||
unixTime: unixTime, | ||
slowTime: slowTime | ||
} |
{ | ||
"name": "pino", | ||
"version": "4.7.1", | ||
"version": "4.7.2", | ||
"description": "super fast, all natural json logger", | ||
@@ -56,3 +56,3 @@ "main": "pino.js", | ||
}, | ||
"homepage": "https://github.com/pinojs/pino#readme", | ||
"homepage": "http://getpino.io", | ||
"devDependencies": { | ||
@@ -59,0 +59,0 @@ "benchmark": "^2.1.2", |
@@ -74,2 +74,6 @@ 'use strict' | ||
if (forceColor && ctx.level === 0) { | ||
ctx.level = 1 | ||
} | ||
levelColors = { | ||
@@ -85,3 +89,3 @@ default: ctx.white, | ||
pipe.call(stream, dest, opts) | ||
return pipe.call(stream, dest, opts) | ||
} | ||
@@ -88,0 +92,0 @@ |
@@ -8,5 +8,6 @@ 'use strict' | ||
test('pino exposes standard time functions', function (t) { | ||
t.plan(4) | ||
t.plan(5) | ||
t.ok(pino.stdTimeFunctions) | ||
t.ok(pino.stdTimeFunctions.epochTime) | ||
t.ok(pino.stdTimeFunctions.unixTime) | ||
t.ok(pino.stdTimeFunctions.slowTime) | ||
@@ -13,0 +14,0 @@ t.ok(pino.stdTimeFunctions.nullTime) |
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
141189
3281