console.log()和console.debug()之间的区别? [英] Difference between console.log() and console.debug()?
问题描述
Google对我没有帮助,因为搜索console.debug只会显示一堆页面上有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.
我想知道 console.log()
和 console.debug()
。有没有办法使用一堆 console.debug()
语句,然后只需翻转一个开关即可轻松关闭所有调试语句被发送到控制台(如之后)启动网站?
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)?
推荐答案
至少对于IE,Firefox和Chrome控制台,.debug()只是一个别名。添加了log()以提高兼容性
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
这篇关于console.log()和console.debug()之间的区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!