doc: console.log() -> console.error() in events.md

PR-URL: https://github.com/nodejs/node/pull/11810
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
Vse Mozhet Byt authored and Myles Borins committed 2017-04-18 20:02:10 -04:00
1 parent f8426d9177
commit 331c0a8a26
1 file changed
+2 -2
+2 -2
View File
@@ -148,7 +148,7 @@ can be used. (_Note, however, that the `domain` module has been deprecated_)
const myEmitter = new MyEmitter();
process.on('uncaughtException', (err) => {
console.log('whoops! there was an error');
console.error('whoops! there was an error');
});
myEmitter.emit('error', new Error('whoops!'));
@@ -160,7 +160,7 @@ As a best practice, listeners should always be added for the `'error'` events.
```js
const myEmitter = new MyEmitter();
myEmitter.on('error', (err) => {
console.log('whoops! there was an error');
console.error('whoops! there was an error');
});
myEmitter.emit('error', new Error('whoops!'));
// Prints: whoops! there was an error