Node.js console.log vs console.info

According to the documentation that you linked to, console.error and console.warn outputs to stderr. The others output to stdout.

If you are doing piping or redirection from node.js the difference is important.

There is a lot of JavaScript written to run in both the browser and Node.js. Having node implement the full console allows for greater code cross-compatibility.

In most browsers, not only do these log in different colors, but you can also filter to see specific messages.

console.info("info");
console.error("error");
console.warn("warn");
console.log("log");

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)