Node.js console.log vs console.info

What is the benefit of using console.log vs console.info? Or any of the other console commands for that matter?

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

vs

console.log("log");

I thought it might change the color of the output or concatenate some sort of label, but they seem to all do the same thing. And according to the documentation here:

http://nodejs.org/api/stdio.html

they seem to all do the same as console.log

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");

console.log() is shorter than console.info()

They're the same thing, and that's the only advantage

enter image description here

According to the docs it's pretty clear.

console.info([data], [...])# Same as console.log.

console.error([data], [...])# Same as console.log but prints to stderr.

console.warn([data], [...])# Same as console.error.

This means there is no benefit or downside. info == log, and warn == error. Unless you want to print to stderr, info and or log will work.

One more detail in addition to the accepted answer: In Chrome and FireFox, console.info log lines are prefixed with a little i icon while console.log lines are not. warn and error lines are prefixed with a little triangle and x, respectively.