Skip to content

Instantly share code, notes, and snippets.

@alexbowers
Created February 19, 2017 20:28
Show Gist options
  • Save alexbowers/455fc1e9fb53a86d4f8df7f1eb810a42 to your computer and use it in GitHub Desktop.
Save alexbowers/455fc1e9fb53a86d4f8df7f1eb810a42 to your computer and use it in GitHub Desktop.
let original_console = window.console;
let console = Object.create(window.console);
console.log = function(msg, formatting) {
formatting = formatting || '';
console.groupCollapsed();
console.trace();
original_console.log(msg, formatting);
console.groupEnd();
}
function force () {
try {
throw new Error;
} catch(e) {
console.log('Message');
console.log('%cMessage', 'color: green');
}
}
function one(a) {
two(a);
}
function two() {
force();
}
one('string');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment