From 97092a9b330c8421ae5e30306264ea6dd284a12b Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Thu, 15 Mar 2018 13:55:37 +0100 Subject: [PATCH] =?UTF-8?q?doc:=20document=20`Console(=E2=80=A6,=20ignoreE?= =?UTF-8?q?rrors)`=20option?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/19372 Reviewed-By: Luigi Pinca Reviewed-By: James M Snell --- doc/api/console.md | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/doc/api/console.md b/doc/api/console.md index 758be14fc65447..12798ceb48c87d 100644 --- a/doc/api/console.md +++ b/doc/api/console.md @@ -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. --> + 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]) + + * `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