bug-clinic icon indicating copy to clipboard operation
bug-clinic copied to clipboard

In SCAN why do we need to user console.error("end"); instead of console.log?

Open yanndebelgique opened this issue 10 years ago • 2 comments

Why ?

res.on("end", function (e) {
  console.error("done!");
});

Why is this not ok?

res.on("end", function (e) {
  console.log("done!");
});

yanndebelgique avatar Nov 30 '14 12:11 yanndebelgique

Because the idea is to separate your diagnostic output from your program's expected output – console.log and console.error print their results to different file descriptors (stdout and stderr, respectively). Is that unclear from the text in the workshopper?

othiym23 avatar Dec 01 '14 19:12 othiym23

apparently not but im just one reference point so... thank you for the tutorials btw!

yanndebelgique avatar Dec 03 '14 19:12 yanndebelgique