Skip to content

Instantly share code, notes, and snippets.

@adrianvlupu
Last active December 20, 2015 03:08
Show Gist options
  • Save adrianvlupu/6061048 to your computer and use it in GitHub Desktop.
Save adrianvlupu/6061048 to your computer and use it in GitHub Desktop.
Minimal debug console
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