Skip to content

Instantly share code, notes, and snippets.

@thejefflarson
Created October 13, 2011 18:10
Show Gist options
  • Save thejefflarson/1284983 to your computer and use it in GitHub Desktop.
Save thejefflarson/1284983 to your computer and use it in GitHub Desktop.
// In case any **console.log** calls slip through there should be a dummy console object
// so any said call doesn't bust the page.
(function(){
if(!window.console){
var console = window.console = {};
_.each(["log", "debug", "info", "warn", "error", "exception", "assert", "dir",
"dirxml", "trace", "group", "groupEnd", "groupCollapsed", "time",
"timeEnd", "profile", "profileEnd", "count", "clear", "notifyFirebug",
"getFirebugElement", "firebug", "element"], function(fn){
console[fn] = function(){};
});
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment