Skip to content

Instantly share code, notes, and snippets.

@aweary
Last active March 15, 2019 00:08
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save aweary/b82b9034bb7d22fef63ec25f50ce8544 to your computer and use it in GitHub Desktop.
Save aweary/b82b9034bb7d22fef63ec25f50ce8544 to your computer and use it in GitHub Desktop.
console.groupWithTrace = (name, fn) => {
console.group(name);
fn();
console.groupCollapsed();
console.trace(name);
console.groupEnd();
console.groupEnd();
};
function add(x, y) {
console.groupWithTrace("add", () => {
console.log({ x, y });
});
return x + y;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment