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:
Georgios Kalpakas 2017-06-14 19:41:57 +03:00 committed by Pete Bacon Darwin
parent 0564dd25e2
commit 01173b9441
1 changed files with 5 additions and 1 deletions

View File

@ -1,11 +1,15 @@
import { Injectable } from '@angular/core';
import { environment } from '../../environments/environment';
@Injectable()
export class Logger {
log(value: any, ...rest) {
if (!environment.production) {
console.log(value, ...rest);
}
}
error(value: any, ...rest) {
console.error(value, ...rest);