Skip to content

Instantly share code, notes, and snippets.

@mjangda
Created February 16, 2011 16:49
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save mjangda/829696 to your computer and use it in GitHub Desktop.
Save mjangda/829696 to your computer and use it in GitHub Desktop.
Console Busting along with Console disabling for production environments
var DEBUG_MODE = true; // Set this value to false for production
if(typeof(console) === 'undefined') {
console = {}
}
if(!DEBUG_MODE || typeof(console.log) === 'undefined') {
// FYI: Firebug might get cranky...
console.log = console.error = console.info = console.debug = console.warn = console.trace = console.dir = console.dirxml = console.group = console.groupEnd = console.time = console.timeEnd = console.assert = console.profile = function() {};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment