Skip to content

Commit 63565e1

Browse files
addaleaxjasnell
authored andcommitted
doc: document Console(…, ignoreErrors) option
PR-URL: #19372 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 678f2c2 commit 63565e1

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

doc/api/console.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,10 @@ changes:
6060
- version: v8.0.0
6161
pr-url: https://github.com/nodejs/node/pull/9744
6262
description: Errors that occur while writing to the underlying streams
63-
will now be ignored.
63+
will now be ignored by default.
6464
-->
6565

66+
6667
<!--type=class-->
6768

6869
The `Console` class can be used to create a simple logger with configurable
@@ -77,9 +78,18 @@ const { Console } = require('console');
7778
const { Console } = console;
7879
```
7980

80-
### new Console(stdout[, stderr])
81+
### new Console(stdout[, stderr][, ignoreErrors])
82+
<!-- YAML
83+
changes:
84+
- version: v8.0.0
85+
pr-url: https://github.com/nodejs/node/pull/9744
86+
description: The `ignoreErrors` option was introduced.
87+
-->
88+
8189
* `stdout` {stream.Writable}
8290
* `stderr` {stream.Writable}
91+
* `ignoreErrors` {boolean} Ignore errors when writing to the underlying streams.
92+
Defaults to `true`.
8393

8494
Creates a new `Console` with one or two writable stream instances. `stdout` is a
8595
writable stream to print log or info output. `stderr` is used for warning or

0 commit comments

Comments
 (0)