fix(aio): do not log messages in production
In dev mode, all messages passed to `Logger` will be logged. In production mode, only warnings and errors will be logged. Fixes #17453
This commit is contained in:
parent
0564dd25e2
commit
01173b9441
@ -1,11 +1,15 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
|
import { environment } from '../../environments/environment';
|
||||||
|
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class Logger {
|
export class Logger {
|
||||||
|
|
||||||
log(value: any, ...rest) {
|
log(value: any, ...rest) {
|
||||||
|
if (!environment.production) {
|
||||||
console.log(value, ...rest);
|
console.log(value, ...rest);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
error(value: any, ...rest) {
|
error(value: any, ...rest) {
|
||||||
console.error(value, ...rest);
|
console.error(value, ...rest);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user