最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - console.log doesn't print the message to the firebug console? - Stack Overflow

programmeradmin4浏览0评论

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. This application uses Dojo/Dijit toolkit. 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.

Please advise about what should I look for. I have also tried Chrome/IE.

Thanks in Advance/

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. This application uses Dojo/Dijit toolkit. 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.

Please advise about what should I look for. I have also tried Chrome/IE.

Thanks in Advance/

Share Improve this question edited Aug 12, 2011 at 23:46 Jared Farrish 49.2k17 gold badges99 silver badges105 bronze badges asked Aug 12, 2011 at 23:42 KarthikKarthik 1,0063 gold badges10 silver badges19 bronze badges 2
  • Could be there is another debugging setup that's intercepting it. If you can post a link or a jsfiddle.net to demonstrate, that would help. – Jared Farrish Commented Aug 12, 2011 at 23:48
  • I have a similar problem once in a while - console.logs on the script don't fire but if I do them manually on the console they work. Restarting the browser solves it. (Still no idea where the issue comes from - I am using Dojo as well however...) – hugomg Commented Aug 13, 2011 at 0:51
Add a comment  | 

4 Answers 4

Reset to default 8

console is not write protected, it can be replaced with anything. You could try

alert(console.log.toString());

to find out what console.log really is

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.

did you try window.console.log()? Maybe you are not in 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. Reload the application. Then in the firebug panel - - > Console - - > All. All the console.log messages will appear.

发布评论

评论列表(0)

  1. 暂无评论