Created
January 9, 2018 10:10
-
-
Save l4ci/a54785aa8986c687f36848d449e83b1f to your computer and use it in GitHub Desktop.
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 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