Skip to content

Instantly share code, notes, and snippets.

@l4ci
Created January 9, 2018 10:10
Show Gist options
  • Select an option

  • Save l4ci/a54785aa8986c687f36848d449e83b1f to your computer and use it in GitHub Desktop.

Select an option

Save l4ci/a54785aa8986c687f36848d449e83b1f to your computer and use it in GitHub Desktop.
var consoleHolder = console;
/**
* Set the debug level
* @type int
* 0/false = disabled
* 1 = enabled
*/
var debug_lvl = false;
function debug(bool){
if ( !bool ){
consoleHolder = console;
console = {};
console.log = function(){};
console.table = function(){};
console.clear = function(){};
}else{
console = consoleHolder;
console.log('Enabled Debugging');
}
debug_lvl = bool;
}
debug(debug_lvl);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment