Skip to content

Instantly share code, notes, and snippets.

@rluvaton
Last active April 29, 2020 21:34
Show Gist options
  • Save rluvaton/36ff14c73d61ecab5eca72147cc62c52 to your computer and use it in GitHub Desktop.
Save rluvaton/36ff14c73d61ecab5eca72147cc62c52 to your computer and use it in GitHub Desktop.
Logger Service in Angular #angular #ts #service #logger
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