Skip to content

Instantly share code, notes, and snippets.

@ilyasakin
Last active July 4, 2022 16:07
Show Gist options
  • Save ilyasakin/79fbac69d25dafc5e1ee414644d9ad48 to your computer and use it in GitHub Desktop.
Save ilyasakin/79fbac69d25dafc5e1ee414644d9ad48 to your computer and use it in GitHub Desktop.
export default class LoggingService {
public log(message: string, payload: unknown = null): void {
console.log(`%cLOG: %c${message}`, 'color: yellow;', 'color: white');
if (payload) {
console.log('LOG_PAYLOAD: ', payload);
}
}
public error(message: string, payload: unknown = null): void {
console.error(`%cERR: %c${message}`, 'color: red; font-weight: bold', 'color: red');
if (payload) {
console.log('ERROR_PAYLOAD: ', payload);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment