console.log()和console.debug()之间的区别? [英] Difference between console.log() and console.debug()?

查看:898
本文介绍了console.log()和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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆