Skip to content

Commit

Permalink
flush and flushSync
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmarkclements committed Jul 18, 2018
1 parent 86f341e commit f4683d2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion benchmarks/utils/generate-benchmark-doc.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ ${run('deep-object')}
For a fair comparison, [LogLevel](http://npm.im/loglevel) was extended
to include a timestamp and [bole](http://npm.im/bole) had
\`fastTime\` mode switched on.
`)
`)
2 changes: 1 addition & 1 deletion benchmarks/utils/runbench.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ function runBenchmark (name, done) {
if (quiet === false) {
benchmark.stdout.pipe(process.stdout)
}

pump(benchmark.stdout, split(), processor)

benchmark.on('exit', () => {
Expand Down
10 changes: 9 additions & 1 deletion docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ Default: `'msg'`

The string key for the 'message' in the JSON object.

<a id=onterminated></a>
#### `onTerminated` (Function)

Default: `(evt, err) => err ? process.exit(1) : process.exit(0)`
Expand Down Expand Up @@ -470,9 +471,16 @@ child.info({test: 'will be overwritten'})

Flushes the content of the buffer when using a `pino.extreme` destination.

It has no effect if extreme mode is not enabled.
This is an asynchronous, fire and forget, operation.

The use case is primarily for Extreme mode logging, which may hold up to
4KiB of logs. The `logger.flush` method can be used to flush the logs
on an long interval, say ten seconds. Such a strategy can provide an
optimium balanace between extremely efficient logging at high demand periods
and safer logging at low demand periods.

* See [`pino.extreme`](#pino-extreme)
* See [`destination` parameter](#destination)
* See [Extreme mode ⇗](/docs/extreme.md)

<a id="level"></a>
Expand Down

0 comments on commit f4683d2

Please sign in to comment.