console.log doesn't always work

1,136 views
Skip to first unread message

Vanco Ordanoski

unread,
May 15, 2012, 3:42:24 PM5/15/12
to Firebug
Hi,
It seems that console.log() (at least, haven't tried other console
methods) doesn't work well in some cases. I've noticed this behaviour
in all versions above (but not including) 1.8.4, including 1.10 alpha.
It's a bit complicated and involves using mootools 1.2.x and its
Classes: http://mootools.net/docs/core125/core/Class/Class

console.log() fails to print anything in the console window when it is
called from a code which contains nested classes. I've prepared a
sample code. It cannot be executed in jsFiddle, because it needs some
of our libraries. The code is cleaned up a bit, without the
unnecessary parts.
For now, I am still on 1.8.4, but would really like to move to the
latest version.

Firebug is my main development tool and has helped me build all our
applications. We really appreciate your hard work and dedication.
Thanks!
Thanks for your help.

var imxParamFormControl = new Class ({
Implements : [Options, Events],
options: {
id : 'ctl_parform',
},
pop_columns : null,
column_model : [],

initialize : function(options) {
this.setOptions(options);
this._popup_render();
return this;
},

_control_render : function() {
console.log('column_model:', this.column_model); // THIS DOESN'T
WORK
return this;
},

_popup_render : function() {
var that = this;
console.log('column_model:', this.column_model); // THIS WORKS!

this.pop_columns = new imxPopupModal({
id: 'pop_columns',
onShow : function() {
console.log('column_model:', that.column_model); // THIS DOESN'T
WORK
that._control_render();
}
}).setContent(this.dict.title, _html);
},
show : function() {
this.pop_columns.show();
return this;
},
});

Sebo

unread,
May 15, 2012, 5:02:09 PM5/15/12
to fir...@googlegroups.com
Here are some questions:
  • What do you mean with "doesn't work well"? Is there no output at all in the console? Are there errors?
  • What does Firefox' internal Web Console show (when Firebug is disabled)?
  • Did you try it with MooTools 1.4.5?
  • Could you create a reproducible test case including all necessary files?
Sebastian

Sebo

unread,
May 15, 2012, 5:05:15 PM5/15/12
to fir...@googlegroups.com
console.log() fails to print anything in the console window when it is called from a code which contains nested classes.
So forget about the first question. Though do you see any errors in Firefox' Error Console?

Sebastian

Vanco Ordanoski

unread,
May 16, 2012, 7:29:56 AM5/16/12
to Firebug
Sorry for the late answer, I was busy out of the company...

> - What does Firefox' internal Web Console show (when Firebug is disabled)?
The internal web console doesn't show the logs also... (works/doesn't
work the same way as Firebug does)

> - Did you try it with MooTools 1.4.5?
I can not try this with Mootools 1.4.5 because our platform is not yet
compatible with that version. For the moment, we are stuck with 1.2.x

> - Could you create a reproducible test case including all necessary files?
I will try this in the following days. It will take some time because
the platform is fairly complicated...

Best regards, Vanco

Sebo

unread,
May 16, 2012, 9:53:02 AM5/16/12
to fir...@googlegroups.com
>   - What does Firefox' internal Web Console show (when Firebug is disabled)?
The internal web console doesn't show the logs also... (works/doesn't
work the same way as Firebug does)
This indicates that it is probably a more general problem. You can check this by replacing the console.log() calls by alert()s and see if they are called and also by comparing the results with other browser's web dev tools.

>   - Did you try it with MooTools 1.4.5?
I can not try this with Mootools 1.4.5 because our platform is not yet
compatible with that version. For the moment, we are stuck with 1.2.x
I see.
 
>   - Could you create a reproducible test case including all necessary files?
I will try this in the following days. It will take some time because
the platform is fairly complicated...
Thanks. So I'll wait for it.

Sebastian

Florent Fayolle

unread,
Mar 9, 2013, 8:47:05 AM3/9/13
to fir...@googlegroups.com, sebastia...@gmx.de, florent fayolle
Hi Sunil,

Yes, I can reproduce your issue:
1. Open this page : http://courses.csail.mit.edu/6.831/2013/activities/ac09-q3.shtml
2. Make sure Firebug is disabled when loading this page. Otherwise, disable it and reload the page.
3. Enable Firebug and switch to the Console Panel
4. Click on "C" or "D"

And a trickier case:
1. Open this page : http://courses.csail.mit.edu/6.831/2013/activities/ac09-q3.shtml
2. Make sure Firebug is **enabled** (this time) when loading this page. Otherwise, enable it and reload the page.
3. Switch to the Console Panel
4. Click on "C" or "D"
5. Disable Firebug
6. Enable both Firebug and WebConsole
7. Click on "C" or "D"
   |=> neither Firebug and WebConsole are logging anything.

I would say it is due to the use of document.write in frames.

I reported your issue there: issue 6312

Florent

On Thursday, March 7, 2013 3:34:34 PM UTC+1, Sunil Gupta wrote:
Hi.

Here's an example in which Firebug fails to record the console.log() statements whereas Firefox's web console does record the messages.  Click in the green box to make a message appear.


--Sunil

Sunil Gupta

unread,
Mar 9, 2013, 6:13:38 PM3/9/13
to fir...@googlegroups.com, sebastia...@gmx.de, florent fayolle
Ah yes, frames could be the culprit.  Thanks for logging it, Florent.

Sunil
Reply all
Reply to author
Forward
0 new messages