Last active
April 29, 2020 21:34
-
-
Save rluvaton/36ff14c73d61ecab5eca72147cc62c52 to your computer and use it in GitHub Desktop.
Logger Service in Angular #angular #ts #service #logger
This file contains 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
import {Injectable} from '@angular/core'; | |
@Injectable({ | |
providedIn: 'root' | |
}) | |
export class LoggerService { | |
constructor() { | |
} | |
verbose(...params) { | |
console.log(...params); | |
} | |
debug(...params) { | |
console.log(...params); | |
} | |
info(message, ...params) { | |
console.log(message, ...params); | |
} | |
warn(message, ...params) { | |
console.log(message, ...params); | |
} | |
error(message, err, ...params) { | |
console.error(message, err || '', ...params); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment