17488 Posts in 4473 Topics by 1978 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1598 Views |
-
console.log() replacement issues

13 June 2007 at 11:18am
There appears to be code in protoype_improvements.js that provides a replacement console.log() in cases where you don't have firebug installed.
The problem is that this has a habit of popping up on production sites.
Who wrote this code? What's the best way of fixing this? Do we need a reliable way of calling Director::isDev() from within javascript, perhaps?
-
Re: console.log() replacement issues

13 June 2007 at 1:38pm
i've implemented the firebug-replacement.
you can use Debug.isTest() in javascript to limit console.log()-calls to non-live environments (has the same restrictions as Director::isLive(), just regexing the url for ".test" and ".dev"). you can override this behaviour with Debug.set_environment_type(). see http://doc.silverstripe.com/doku.php?id=debugthen again, console.log()-code should not be committed at all - it produces a javascript-error if the firebug-replacement is not existing.
-
Re: console.log() replacement issues

13 June 2007 at 2:39pm
Alright, I've stitched these two up. If you're on a live site, then the console.log messages will be silently dropped.
I also fixed Debug.isLive() - it now calls !Debug.isDev()
Although you're right about getting rid of console.log messages after you've finished debugging, this will prevent ones that slip through from breaking sites.
Changeset here: http://trac.silverstripe.com/projects/gsoc/changeset/36771
| 1598 Views | ||
|
Page:
1
|
Go to Top |


