Last active
December 20, 2015 03:08
-
-
Save adrianvlupu/6061048 to your computer and use it in GitHub Desktop.
Minimal debug console
This file contains 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={ | |
enabled: true, | |
init: function () { | |
if (this.enabled) | |
$('body').append('<div id="debug" style="position:absolute;bottom:0;right:0;background:#FFF;border:solid 1px #000;font-size:10px;padding:5px;"></div>'); | |
}, | |
write: function () { | |
if (this.enabled) { | |
for(var i in arguments) | |
$('#debug').append('<div>' + ((typeof arguments[i]==='object')?JSON.stringify(arguments[i]):arguments[i]) + '</div>'); | |
} | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment