Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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. 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/

like image 485
Karthik Avatar asked Aug 12 '11 23:08

Karthik


People also ask

How do I print messages from console log?

log() is a function in JavaScript that is used to print any kind of variables defined before in it or to just print any message that needs to be displayed to the user. Syntax: console. log(" ");

Is print the same as console log?

They actually serve different functions. Print, or any variation thereof, prints out to the browser (the client). Console. log prints to the console, which can be seen by turning on your “inspect element” debugging tools.

How do I enable console debugging?

To open the Debug Console, use the Debug Console action at the top of the Debug pane or use the View: Debug Console command (Ctrl+Shift+Y).

How do I view console log in Chrome?

To open the developer console in Google Chrome, open the Chrome Menu in the upper-right-hand corner of the browser window and select More Tools > Developer Tools. You can also use Option + ⌘ + J (on macOS), or Shift + CTRL + J (on Windows/Linux).


1 Answers

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.

like image 99
user123444555621 Avatar answered Oct 05 '22 06:10

user123444555621