Tag Archives: firebug

Overriding Firebug

The other day at work, I deployed a test release of a product to the test servers, which ofcourse gave some problems… It seems that our CEO’s and other devs didn’t have Firebug installed which caused the app to stop loading. The reason for this is, that I like the console.log() feature, which I use intensively while developing apps.

I then started to uncomment all my console.log() statements before deploying to test servers, but it seemed rather stupid, and the only other alternative was to get the CEO’s and devs to install firebug (and to make them stop using IE for matter). *cough* I decided to find a way to override the console.log() command instead, and I just wanted to share it with you.

try {
	console.log("console.log test"); 
}
catch(e) {
	console = {
		log: function(a) {
			// blank..
		}
	};
}

Just put this tiny piece of code at the very top of you file, then it overrides the console.log() command, and all is well! Tested in IE6+7, Opera 9.25 and Firefox (without firebug installed).