Creating a Wrapper for Firebug's Console [Tips & Tricks] | Posted at 12:20 PM
Thanks to Dimitar over at Frag on how to create a wrapper for Firebug's console, I was able to implement better debugging in my jQuery plugin. The one quip I had was that I needed to directly pass everything to the log function. The way Dimitar did it, it wrote a log line for each argument. I was passing formatted strings.
Here are the offending lines:
for (var i = 0, l = arguments.length; i < l; i++) console.log(arguments[i]);
And here's what you replace it with:
console.log.apply(this, arguments);
BAM! Works like a charm.
Thanks Dimitar!

Comments
hey - thanks for the tip. I should have read the firebug source / manual to see if there was a more appropriate method than looping through vars :)
updated and credited.
Posted by: Dimitar Christoff
On January 17, 2009 2:13 AM
tried hours and hours to get this... thank you so much! really works like charm ;)
Posted by: conrad
On July 7, 2009 12:50 PM
erm - you may want to update it as the apply breaks on Safari 4's console.log (probably not a normal function).
added a try block instead - check the original post :)
Posted by: Dimitar Christoff
On August 15, 2009 6:10 AM