简体   繁体   English

console.log 不会将消息打印到 firebug 控制台?

[英]console.log doesn't print the message to the firebug console?

I am facing this weird problem.我正面临这个奇怪的问题。 The WebApp I'm debugging right now, is invoking the javascript console.log/console.log/error/debug/etc., the Firebug console however, doesn't print them at all.我现在正在调试的 WebApp 正在调用 javascript console.log/console.log/error/debug/etc.,但是 Firebug 控制台根本不打印它们。 This application uses Dojo/Dijit toolkit.此应用程序使用 Dojo/Dijit 工具包。 Not sure if there is anything special about it不知道有没有什么特别之处

It doesn't appear to be a problem with the Browser, I tried another simple web-page with a console.debug call, and the message appears on the console as expected.浏览器似乎没有问题,我尝试了另一个带有 console.debug 调用的简单网页,消息按预期出现在控制台上。

Please advise about what should I look for.请告知我应该寻找什么。 I have also tried Chrome/IE.我也尝试过 Chrome/IE。

Thanks in Advance/提前致谢/

console is not write protected, it can be replaced with anything. console没有写保护,它可以用任何东西替换。 You could try你可以试试

alert(console.log.toString());

to find out what console.log really is找出console.log到底是什么

Edit:编辑:

A better method would be更好的方法是

var originalConsole = console;
// now include your library
// ...
originalConsole.log(console.log);

In Firebug, clicking on the function takes you directly to its definition.在 Firebug 中,单击 function 可直接进入其定义。

did you try window.console.log() ?你试过window.console.log()吗? Maybe you are not in window scope也许你不在 window scope

In case like this do not forget to check if "Logging" is enabled or active at your console of browser.在这种情况下,不要忘记检查您的浏览器控制台是否启用或激活了“日志记录”。

Just to update this question -: Ensure that firebug is Enabled - - > On for all Web Pages.只是为了更新这个问题-:确保所有 Web 页面都启用了萤火虫。 Reload the application.重新加载应用程序。 Then in the firebug panel - - > Console - - > All.然后在firebug面板-->控制台-->全部。 All the console.log messages will appear.所有的 console.log 消息都会出现。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM