From b473f360d51c2841d3632bfdf6145dae199b3ab1 Mon Sep 17 00:00:00 2001 From: Janek Lasocki-Biczysko Date: Mon, 8 May 2023 08:44:29 +0100 Subject: [PATCH] docs: add 'best performance for basic stdout logging' to help.md (#1584) * docs: add 'best performance for basic stdout logging' to help.md My attempt to capture @mcollina's reply: https://github.com/pinojs/pino/issues/1491#issuecomment-1180129193 in some doc form * change help section * Update docs/help.md Co-authored-by: Matteo Collina * Update docs/help.md Co-authored-by: Matteo Collina --------- Co-authored-by: Matteo Collina --- docs/help.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/docs/help.md b/docs/help.md index 02723d42a..a0aea6fde 100644 --- a/docs/help.md +++ b/docs/help.md @@ -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 logging to `stdout`](#best-performance-for-stdout) ## Log rotation @@ -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"} ``` + + +## Best performance for logging to `stdout` + +The best performance for logging directly to stdout is _usually_ achieved by using the +default configuration: + +```js +const log = require('pino')(); +``` + +You should only have to configure custom transports or other settings +if you have broader logging requirements.