src/app/shared/services/logger.service.ts
A service for global logs.
Methods |
constructor()
|
Defined in src/app/shared/services/logger.service.ts:10
|
Static error | ||||||||||||
error(value: any, ...rest: any[])
|
||||||||||||
Defined in src/app/shared/services/logger.service.ts:21
|
||||||||||||
Parameters :
Returns :
void
|
error | ||||||||||||
error(value: any, ...rest: any[])
|
||||||||||||
Defined in src/app/shared/services/logger.service.ts:33
|
||||||||||||
Parameters :
Returns :
void
|
Static log | ||||||||||||
log(value: any, ...rest: any[])
|
||||||||||||
Defined in src/app/shared/services/logger.service.ts:15
|
||||||||||||
Parameters :
Returns :
void
|
log | ||||||||||||
log(value: any, ...rest: any[])
|
||||||||||||
Defined in src/app/shared/services/logger.service.ts:29
|
||||||||||||
Parameters :
Returns :
void
|
Static warn | ||||||||||||
warn(value: any, ...rest: any[])
|
||||||||||||
Defined in src/app/shared/services/logger.service.ts:25
|
||||||||||||
Parameters :
Returns :
void
|
warn | ||||||||||||
warn(value: any, ...rest: any[])
|
||||||||||||
Defined in src/app/shared/services/logger.service.ts:37
|
||||||||||||
Parameters :
Returns :
void
|
import { Injectable } from '@angular/core';
import { environment } from '../../../environments/environment';
/**
* A service for global logs.
*
* @author Damien Vitrac
*/
@Injectable()
export class LoggerService {
constructor() {
}
static log(value: any, ...rest: any[]) {
if (!environment.production) {
console.log(value, ...rest);
}
}
static error(value: any, ...rest: any[]) {
console.error(value, ...rest);
}
static warn(value: any, ...rest: any[]) {
console.warn(value, ...rest);
}
log(value: any, ...rest: any[]) {
LoggerService.log(value, ...rest);
}
error(value: any, ...rest: any[]) {
LoggerService.error(value, ...rest);
}
warn(value: any, ...rest: any[]) {
LoggerService.warn(value, ...rest);
}
}