import { Injectable } from '@angular/core' ; import { environment } from '../../../environments/environment' ; interface LoggingFunction { ( value , ... rest ) : void ; } export interface LoggerService { info : LoggingFunction ; log : LoggingFunction ; warn : LoggingFunction ; error : LoggingFunction ; } @ Injectable ( { providedIn : 'root' } ) export class BrowserLoggerService implements LoggerService { info ( value , ... rest ) { if ( ! environment . production ) { console . info ( value , rest ) ; } else { } } log ( value , ... rest ) { if ( ! environment . production ) { console . log ( value , rest ) ; } else { } } warn ( value , ... rest ) { if ( ! environment . production ) { console . warn ( value , rest ) ; } else { } } error ( value , ... rest ) { if ( ! environment . production ) { console . error ( value , rest ) ; } else { } } }