What is the difference between console.log
and process._rawDebug
?
This answer tells me that console.log
actually calls process.stdout.write
with formatting and a new line at the end. According to this article process._rawDebug
also writes to the terminal but uses process.stderr
. I'm not sure how reliable this article is, though.
I logged 10.000 messages (for testing purposes) to the console using console.log
and process._rawDebug
. The later was at least twice as fast which should mean something I guess.
Are there any dis(advantages) of using console.log
or process._rawDebug
? Which one is better/safer to use for logging small messages?