Skip to content

Instantly share code, notes, and snippets.

@Alexintosh
Created February 12, 2018 13:19
Show Gist options
  • Save Alexintosh/aa8b319c63fc5e6154ffb3e16fd74823 to your computer and use it in GitHub Desktop.
Save Alexintosh/aa8b319c63fc5e6154ffb3e16fd74823 to your computer and use it in GitHub Desktop.
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