Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed console.error to console.log #24112

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions doc/api/stream.md
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ for (let i = 0; i < 100; i++) {
}
writer.end('This is the end\n');
writer.on('finish', () => {
console.error('All writes are now complete.');
console.log('All writes are now complete.');
});
```

Expand All @@ -309,7 +309,7 @@ a readable stream, adding this writable to its set of destinations.
const writer = getWritableStreamSomehow();
const reader = getReadableStreamSomehow();
writer.on('pipe', (src) => {
console.error('something is piping into the writer');
console.log('Something is piping into the writer.');
assert.equal(src, reader);
});
reader.pipe(writer);
Expand All @@ -334,7 +334,7 @@ This is also emitted in case this [`Writable`][] stream emits an error when a
const writer = getWritableStreamSomehow();
const reader = getReadableStreamSomehow();
writer.on('unpipe', (src) => {
console.error('Something has stopped piping into the writer.');
console.log('Something has stopped piping into the writer.');
assert.equal(src, reader);
});
reader.pipe(writer);
Expand Down Expand Up @@ -551,7 +551,7 @@ function write(data, cb) {

// Wait for cb to be called before doing any other write.
write('hello', () => {
console.log('write completed, do more writes now');
console.log('Write completed, do more writes now.');
});
```

Expand Down Expand Up @@ -1091,7 +1091,7 @@ const readable = getReadableStreamSomehow();
readable.setEncoding('utf8');
readable.on('data', (chunk) => {
assert.equal(typeof chunk, 'string');
console.log('got %d characters of string data', chunk.length);
console.log('Got %d characters of string data:', chunk.length);
});
```

Expand Down Expand Up @@ -1119,9 +1119,9 @@ const writable = fs.createWriteStream('file.txt');
// but only for the first second
readable.pipe(writable);
setTimeout(() => {
console.log('Stop writing to file.txt');
console.log('Stop writing to file.txt.');
readable.unpipe(writable);
console.log('Manually close the file stream');
console.log('Manually close the file stream.');
writable.end();
}, 1000);
```
Expand Down Expand Up @@ -1338,9 +1338,9 @@ const rs = fs.createReadStream('archive.tar');

finished(rs, (err) => {
if (err) {
console.error('Stream failed', err);
console.error('Stream failed.', err);
} else {
console.log('Stream is done reading');
console.log('Stream is done reading.');
}
});

Expand All @@ -1360,7 +1360,7 @@ const rs = fs.createReadStream('archive.tar');

async function run() {
await finished(rs);
console.log('Stream is done reading');
console.log('Stream is done reading.');
}

run().catch(console.error);
Expand Down Expand Up @@ -1395,9 +1395,9 @@ pipeline(
fs.createWriteStream('archive.tar.gz'),
(err) => {
if (err) {
console.error('Pipeline failed', err);
console.error('Pipeline failed.', err);
} else {
console.log('Pipeline succeeded');
console.log('Pipeline succeeded.');
}
}
);
Expand All @@ -1414,7 +1414,7 @@ async function run() {
zlib.createGzip(),
fs.createWriteStream('archive.tar.gz')
);
console.log('Pipeline succeeded');
console.log('Pipeline succeeded.');
}

run().catch(console.error);
Expand Down