Created
February 12, 2018 13:19
-
-
Save Alexintosh/aa8b319c63fc5e6154ffb3e16fd74823 to your computer and use it in GitHub Desktop.
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
const l = () => { | |
// tslint:disable-next-line:one-variable-per-declaration | |
const stack = new Error().stack, | |
caller = stack.split('\n')[2].trim(); | |
let args = Array.prototype.slice.call(arguments); | |
console.log.apply(this, [caller, args]); | |
}; | |
const i = () => { | |
// tslint:disable-next-line:one-variable-per-declaration | |
const stack = new Error().stack, | |
caller = stack.split('\n')[2].trim(); | |
let args = Array.prototype.slice.call(arguments); | |
console.info.apply(this, [caller, args]); | |
}; | |
/** | |
* Usage | |
* Strongly advices to bind a snipplet to it: https://code.visualstudio.com/docs/editor/userdefinedsnippets | |
*/ | |
l(arguments); | |
i(arguments); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment