othiym23 / bug-clinic

a nodeschool.io-style workshopper for learning how to debug Node.js apps
https://npmjs.org/package/bug-clinic
BSD 2-Clause "Simplified" License
175 stars 49 forks source link

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

Open yanndebelgique opened 9 years ago

yanndebelgique commented 9 years ago

Why ?

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

Why is this not ok?

res.on("end", function (e) {
  console.log("done!");
});
othiym23 commented 9 years ago

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?

yanndebelgique commented 9 years ago

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