Skip to content

Instantly share code, notes, and snippets.

@MrPeker
Last active November 9, 2019 22:09
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MrPeker/8d5c9f6ba575186048ad711d132b676c to your computer and use it in GitHub Desktop.
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?"
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