Search code examples
javascriptconsoleconsole.logweb-developer-toolbar

Difference between console.log() and console.debug()?


Google has not been helpful for me, since searching for "console.debug" just brings up a bunch of pages that have the words "console" and "debug" on them.

I'm wondering what the difference is between console.log() and console.debug(). Is there some way to use a bunch of console.debug() statements and then just flip a switch to easily shut off all debug statements from being sent to the console (like after launching a site)?


Solution

  • For at least IE, Firefox and Chrome consoles, .debug() is just an alias for .log() added for improved compatibility

    https://developer.mozilla.org/en-US/docs/Web/API/console

    https://developers.google.com/chrome-developer-tools/docs/console-api#consoledebugobject_object

    https://msdn.microsoft.com/en-us/library/ie/hh772183(v=vs.85).aspx