All files / src/app/common/logger logger.ts

100% Statements 12/12
100% Branches 0/0
100% Functions 4/4
100% Lines 9/9
1 2 3 4 5 6 7 8 9 10 11 12 13 141x     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);
  }
}