Skip to content

Commit

Permalink
docs: add 'best performance for basic stdout logging' to help.md
Browse files Browse the repository at this point in the history
My attempt to capture @mcollina's reply: pinojs#1491 (comment) in some doc form
  • Loading branch information
janeklb authored Nov 6, 2022
1 parent 121c71d commit 00f475e
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions docs/help.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
* [Unicode and Windows terminal](#windows)
* [Mapping Pino Log Levels to Google Cloud Logging (Stackdriver) Severity Levels](#stackdriver)
* [Avoid Message Conflict](#avoid-message-conflict)
* [Best performance for basic stdout logging](#best-performance-for-stdout)

<a id="rotate"></a>
## Log rotation
Expand Down Expand Up @@ -288,3 +289,16 @@ log.info({ msg: 'mapped to originalMsg' }, 'a message')
// {"level":30,"time":1596313323106,"pid":63739,"hostname":"foo","msg":"no original message"}
// {"level":30,"time":1596313323107,"pid":63739,"hostname":"foo","msg":"a message","originalMsg":"mapped to originalMsg"}
```

<a id="best-performance-for-stdout"></a>
## Best performance for basic stdout logging

The best performance for logging directly to stdout is achieved by using the
default configuration:

```js
const log = require('pino')();
```

You should only have to configure custom transports if you have broader logging
requirements.

0 comments on commit 00f475e

Please # to comment.