Skip to content

Instantly share code, notes, and snippets.

@rubeniskov
Last active October 12, 2016 13:05
Show Gist options
  • Save rubeniskov/ea1d867c66a4ed1c1e14abacf082765e to your computer and use it in GitHub Desktop.
Save rubeniskov/ea1d867c66a4ed1c1e14abacf082765e to your computer and use it in GitHub Desktop.
Sometime when console trace is put in a file if we lost where is it, this util can be usefull to locate it
function getErrorObject() {
try {
throw Error('')
} catch (err) {
return err;
}
}
var test = console.log;
console.log = function() {
test.apply(this, [getErrorObject().stack.split("\n")[4]].concat(arguments));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment