What is the benefit of using console.log
vs console.info
?
Or any of the other console commands for that matter?
console.info(\"info\")
The different logging levels let you manage the noise level in your console: In both the Firefox (I'm using 78 right now) and Chrome (84) devtools, the js console lets you choose what "debug level" of output you want to see. FF lets you toggle the visibility of console.error
, .warn
, .log
, .info
, and .debug
messages by clicking individual buttons for each (that show you how many were suppressed, when "off"), whereas Chrome has a dropdown with checkmarks next to the items (.info
and .log
are controlled by the "Info" one, and .debug
by "Verbose"). The Chrome dropdown label ("All levels" or whatever you set) turns red if output was suppressed.