Created
May 30, 2014 08:42
-
-
Save fjaguero/a4ff98df0638c8fbd157 to your computer and use it in GitHub Desktop.
Console.log improvement
This file contains 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
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