Last active
November 25, 2015 17:28
-
-
Save yongzhihuang/a890ca78f369fad4ce3d to your computer and use it in GitHub Desktop.
Debug mode console log - credit to an kiddy script which I do not have the URL for
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var debug = false; | |
var oldlog = console.log; | |
console.log1 = function() { | |
if (debug) { | |
oldlog.apply(this, Array.prototype.slice.call(arguments)); | |
} | |
}; | |
//usage | |
debug = true; | |
console.log1('this message will show up'); | |
debug = false; | |
console.log1('this message will not show up'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment