Skip to content

Instantly share code, notes, and snippets.

@vitalyp
Last active August 29, 2015 13:57
Show Gist options
  • Save vitalyp/9441352 to your computer and use it in GitHub Desktop.
Save vitalyp/9441352 to your computer and use it in GitHub Desktop.
function pop_console() {
document.getElementsByTagName("body")[0].innerHTML='<div id="popconsole" style="width: 100%; height: 130px; z-index: 10000; text-size: 10px; font-family: monospace; color: white; overflow: scroll; opacity: 0.5; position: fixed; bottom: 0px; left: 0px; background: rgb(3, 10, 41);"></div>'+document.getElementsByTagName("body")[0].innerHTML;
}
var console = {};
var console_counter = 100;
console.log = function(text){
console_counter = console_counter + 1;
document.getElementById('popconsole').innerHTML = document.getElementById('popconsole').innerHTML + "<br/><font style='color: green'>"+console_counter+"> </font>" + text;
}
console.info = function(text){
console_counter = console_counter + 1;
document.getElementById('popconsole').innerHTML = document.getElementById('popconsole').innerHTML + "<br/><font style='color: white'>"+console_counter+"> </font>" + text;
}
console.warn = function(text){
console_counter = console_counter + 1;
document.getElementById('popconsole').innerHTML = document.getElementById('popconsole').innerHTML + "<br/><font style='color: yellow'>"+console_counter+"> </font>" + text;
}
console.error = function(text){
console_counter = console_counter + 1;
document.getElementById('popconsole').innerHTML = document.getElementById('popconsole').innerHTML + "<br/><font style='color: red'>"+console_counter+"> </font>" + text;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment