Dojo has had a supplement console wrapper (and shipped firebuglite) for
some years now:
{{{
// Be careful to leave 'log' always at the end
var cn = [
"assert", "count", "debug", "dir", "dirxml", "error", "group",
"groupEnd", "info", "profile", "profileEnd", "time", "timeEnd",
"trace", "warn", "log"
];
var i = 0, tn;
while((tn=cn[i++])){
if(!console[tn]){
(function(){
var tcn = tn+"";
console[tcn] = ('log' in console) ? function(){
var a = Array.apply({}, arguments);
a.unshift(tcn+":");
console["log"](a.join(" "));
} : function(){}
console[tcn]._fake = true;
})();
}
}
}}}
FirebugLite has come a long way over the years, too. You can <!-- IE lt
8 --><script src=firebuglite.js></script> iirc.
~phiggins
On 4/8/11 10:58 AM, Jeremy Solarz wrote:
Yeah of course this would be a solution.
Was just interested if their exist some common solutions which are
driven by the community.
Thanks anyway
On Fri, Apr 8, 2011 at 4:00 PM, Rob Griffiths <[email protected]
<mailto:[email protected]>> wrote:
I don't use it, I tend to just litter my code with console.log.
This has however bitten me several times. Especially with IE. As
Andrew says write your own wrapper if you want.
Or add
var console;
if (!console) console = {log: function() {}}
making console.log a no op on systems that don't have it.
--
Rob Griffiths
http://bytespider.eu
On Friday, 8 April 2011 at 14:54, Jeremy Solarz wrote:
Yeah I also found that one first,
but are any of you people actually using this?
If so how is your experience with it.
On Fri, Apr 8, 2011 at 3:18 PM, Rob Griffiths <[email protected]
<mailto:[email protected]>> wrote:
Jeremy,
Checkout Ben Alman's Debug.
http://benalman.com/projects/javascript-debug-console-log/
--
Rob Griffiths
http://bytespider.eu
On Friday, 8 April 2011 at 14:14, Jeremy Solarz wrote:
Hi folks,
it seems that this question has never been asked, but do you
know a good wrapper for firefoxs, chromes
console.log function.
In case IE dev tools are not activated you get an error calling
console.log.
Sometimes it happens to me that I forget to remove the
console.log before pushing content to live.
How are you dealing with this.
A good solution for me would include cross browser support and
a centralized on/off switch for
debugging in JS
Regards
Jeremy
--
To view archived discussions from the original JSMentors
Mailman list: http://www.mail-archive.com/[email protected]/
To search via a non-Google archive, visit here:
http://www.mail-archive.com/[email protected]/
To unsubscribe from this group, send email to
[email protected]
<mailto:[email protected]>
--
To view archived discussions from the original JSMentors Mailman
list: http://www.mail-archive.com/[email protected]/
To search via a non-Google archive, visit here:
http://www.mail-archive.com/[email protected]/
To unsubscribe from this group, send email to
[email protected]
<mailto:jsmentors%[email protected]>
--
DI Jeremy Solarz
Spittelauer Laende 9/Top 12
1090 Wien
Mobil: +43 699 17 14 33 63
e-mail: [email protected] <mailto:[email protected]>
--
To view archived discussions from the original JSMentors Mailman
list: http://www.mail-archive.com/[email protected]/
To search via a non-Google archive, visit here:
http://www.mail-archive.com/[email protected]/
To unsubscribe from this group, send email to
[email protected]
<mailto:[email protected]>
--
To view archived discussions from the original JSMentors Mailman
list: http://www.mail-archive.com/[email protected]/
To search via a non-Google archive, visit here:
http://www.mail-archive.com/[email protected]/
To unsubscribe from this group, send email to
[email protected]
<mailto:jsmentors%[email protected]>
--
DI Jeremy Solarz
Spittelauer Laende 9/Top 12
1090 Wien
Mobil: +43 699 17 14 33 63
e-mail: [email protected] <mailto:[email protected]>
--
To view archived discussions from the original JSMentors Mailman list:
http://www.mail-archive.com/[email protected]/
To search via a non-Google archive, visit here:
http://www.mail-archive.com/[email protected]/
To unsubscribe from this group, send email to
[email protected]
--
To view archived discussions from the original JSMentors Mailman list:
http://www.mail-archive.com/[email protected]/
To search via a non-Google archive, visit here:
http://www.mail-archive.com/[email protected]/
To unsubscribe from this group, send email to
[email protected]