Skip to content

Commit

Permalink
doc: document Console(…, ignoreErrors) option
Browse files Browse the repository at this point in the history
PR-URL: #19372
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
addaleax authored and jasnell committed Apr 16, 2018
1 parent 678f2c2 commit 63565e1
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions doc/api/console.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 63565e1

Please sign in to comment.