| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 | 1x 1x 13x 1x 1x 1x 1x 1x 1x | import {Injectable, Optional, Inject} from '@angular/core';
@Injectable()
export class Logger {
constructor(private prefix: string, private style: string) {}
log(message: string) {
console.log(`%c${this.prefix} | ${message}`, this.style);
}
error(message: string) {
this.style += ' color: red;';
console.log(`%c${this.prefix} | ${message}`, this.style);
}
}
|