Comparing version 6.11.0 to 6.11.1
@@ -19,2 +19,15 @@ 'use strict' | ||
function shouldSerialize (serialize, serializers) { | ||
if (Array.isArray(serialize)) { | ||
const hasToFilter = serialize.filter(function (k) { | ||
return k !== '!stdSerializers.err' | ||
}) | ||
return hasToFilter | ||
} else if (serialize === true) { | ||
return Object.keys(serializers) | ||
} | ||
return false | ||
} | ||
function pino (opts) { | ||
@@ -30,7 +43,3 @@ opts = opts || {} | ||
const serializers = opts.serializers || {} | ||
const serialize = Array.isArray(opts.browser.serialize) | ||
? opts.browser.serialize.filter(function (k) { | ||
return k !== '!stdSerializers.err' | ||
}) | ||
: opts.browser.serialize === true ? Object.keys(serializers) : false | ||
const serialize = shouldSerialize(opts.browser.serialize, serializers) | ||
let stdErrSerialize = opts.browser.serialize | ||
@@ -37,0 +46,0 @@ |
@@ -292,9 +292,17 @@ # API | ||
Enables or disables the inclusion of a timestamp in the | ||
log message. If a function is supplied, it must synchronously return a JSON string | ||
log message. If a function is supplied, it must synchronously return a partial JSON string | ||
representation of the time, e.g. `,"time":1493426328206` (which is the default). | ||
If set to `false`, no timestamp will be included in the output. | ||
See [stdTimeFunctions](#pino-stdtimefunctions) for a set of available functions | ||
for passing in as a value for this option. | ||
Example: | ||
```js | ||
timestamp: () => `,"time":"${new Date(Date.now()).toISOString()}"` | ||
// which is equivilent to: | ||
// timestamp: stdTimeFunctions.isoTime | ||
``` | ||
**Caution**: attempting to format time in-process will significantly impact logging performance. | ||
@@ -301,0 +309,0 @@ |
# Transports | ||
A "transport" for Pino is supplementary tool which consumes Pino logs. | ||
A "transport" for Pino is a supplementary tool which consumes Pino logs. | ||
@@ -79,2 +79,3 @@ Consider the following example: | ||
+ [pino-http-send](#pino-http-send) | ||
+ [pino-kafka](#pino-kafka) | ||
+ [pino-logflare](#pino-logflare) | ||
@@ -214,2 +215,11 @@ + [pino-mq](#pino-mq) | ||
<a id="pino-kafka"></a> | ||
### pino-kafka | ||
[pino-kafka](https://github.com/ayZagen/pino-kafka) transport to send logs to [Apache Kafka](https://kafka.apache.org/). | ||
```sh | ||
$ node index.js | pino-kafka -b 10.10.10.5:9200 -d mytopic | ||
``` | ||
<a id="pino-logflare"></a> | ||
@@ -216,0 +226,0 @@ ### pino-logflare |
@@ -128,5 +128,5 @@ 'use strict' | ||
? Object.keys(customLevels).reduce((o, k) => { | ||
o[customLevels[k]] = k | ||
return o | ||
}, {}) | ||
o[customLevels[k]] = k | ||
return o | ||
}, {}) | ||
: null | ||
@@ -133,0 +133,0 @@ |
{ | ||
"name": "pino", | ||
"version": "6.11.0", | ||
"version": "6.11.1", | ||
"description": "super fast, all natural json logger", | ||
@@ -5,0 +5,0 @@ "main": "pino.js", |
@@ -300,4 +300,4 @@ 'use strict' | ||
await once(child, 'close') | ||
isNot(strip(actual).match(/WARN\s+: pino.final with prettyPrint does not support flushing/), null) | ||
isNot(strip(actual).match(/INFO\s+\(123456 on abcdefghijklmnopqr\): beforeExit/), null) | ||
isNot(strip(actual).match(/WARN\s*: pino.final with prettyPrint does not support flushing/), null) | ||
isNot(strip(actual).match(/INFO\s*\(123456 on abcdefghijklmnopqr\): beforeExit/), null) | ||
}) | ||
@@ -304,0 +304,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
319291
7473