doc: document Console(…, ignoreErrors) option

PR-URL: https://github.com/nodejs/node/pull/19372
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
Anna Henningsen 2018-03-15 13:55:37 +01:00
parent 681c1d2f2c
commit 65765989d3
No known key found for this signature in database
GPG Key ID: 9C63F3A6CD2AD8F9

View File

@ -60,9 +60,10 @@ changes:
- version: v8.0.0
pr-url: https://github.com/nodejs/node/pull/9744
description: Errors that occur while writing to the underlying streams
will now be ignored.
will now be ignored by default.
-->
<!--type=class-->
The `Console` class can be used to create a simple logger with configurable
@ -77,9 +78,18 @@ const { Console } = require('console');
const { Console } = console;
```
### new Console(stdout[, stderr])
### new Console(stdout[, stderr][, ignoreErrors])
<!-- YAML
changes:
- version: v8.0.0
pr-url: https://github.com/nodejs/node/pull/9744
description: The `ignoreErrors` option was introduced.
-->
* `stdout` {stream.Writable}
* `stderr` {stream.Writable}
* `ignoreErrors` {boolean} Ignore errors when writing to the underlying streams.
Defaults to `true`.
Creates a new `Console` with one or two writable stream instances. `stdout` is a
writable stream to print log or info output. `stderr` is used for warning or