Last active
November 9, 2019 22:09
-
-
Save MrPeker/8d5c9f6ba575186048ad711d132b676c to your computer and use it in GitHub Desktop.
Customize your console log output for don't ask "this output from which line?"
This file contains hidden or 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
let log = console.log; | |
console.log = function() { | |
log(""); | |
log.apply(console, arguments); | |
let info = new Error().stack.split(' at ')[2].trim().split(__dirname); | |
log('-- from', '\x1b[33m', info[0].split(' (')[0], '\x1b[0m', 'at', '\x1b[33m', info[1], '\x1b[0m'); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment