Skip to content

Instantly share code, notes, and snippets.

@leohxj
Created July 15, 2019 02:11
Show Gist options
  • Save leohxj/2ddea05f87285334684271a7175d92b9 to your computer and use it in GitHub Desktop.
Save leohxj/2ddea05f87285334684271a7175d92b9 to your computer and use it in GitHub Desktop.
custom logger
export const logger = (name, ...args) => {
if (process.env.NODE_ENV === 'development') {
// eslint-disable-next-line
console.groupCollapsed(`logger --> ${name}`);
// eslint-disable-next-line
console.log(...args);
// eslint-disable-next-line
console.groupEnd();
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment