Created
June 4, 2018 01:30
-
-
Save jairoFernandez/9808cd0fa487811ba68e5e4220689f6e to your computer and use it in GitHub Desktop.
Imprimir consola
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
(function () { | |
if (!console) { | |
console = {}; | |
} | |
var old = console.log; | |
var logger = document.getElementById('log'); | |
console.log = function (message) { | |
if (typeof message == 'object') { | |
logger.innerHTML += (JSON && JSON.stringify ? JSON.stringify(message) : String(message)) + '<br />'; | |
} else { | |
logger.innerHTML += message + '<br />'; | |
} | |
} | |
})(); | |
console.log("Hola") | |
console.log('test'); | |
console.log({ | |
test: 2 | |
}); | |
console.log([1, 2, 3]); | |
console.log([{ | |
test: 1 | |
}, { | |
test: 2 | |
}]); |
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
<div id="log"></div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment