Skip to content

Instantly share code, notes, and snippets.

@fjaguero
Created May 30, 2014 08:42
Show Gist options
  • Save fjaguero/a4ff98df0638c8fbd157 to your computer and use it in GitHub Desktop.
Save fjaguero/a4ff98df0638c8fbd157 to your computer and use it in GitHub Desktop.
Console.log improvement
console.clear();
var old = console.log;
console.log = function() {
var args = [].slice.apply(arguments).concat([(new Error()).stack.split(/\n/)[2].trim()]);
return old.apply(this, args);
};
function test(t) {
console.log(t);
}
test('zx');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment