Skip to content

Instantly share code, notes, and snippets.

@greggman
Last active November 18, 2015 11:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save greggman/8a99fd136f2ed44c93e9 to your computer and use it in GitHub Desktop.
Save greggman/8a99fd136f2ed44c93e9 to your computer and use it in GitHub Desktop.
<script>
(function() {
var insert = function(e) {
var elem = document.createElement("pre");
elem.appendChild(document.createTextNode(Array.prototype.join.call(arguments, " ")));
document.body.insertBefore(elem, document.body.firstChild);
};
window.addEventListener('error', insert);
window.console.log = function(origFn) {
return function() {
insert(arguments[0]);
origFn.apply(window.console, arguments);
};
}(window.console.log);
}());
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment