合并为一个项目 #14

Merged
xiaohai2271 merged 56 commits from issue11 into master 2020-05-16 22:35:08 +08:00
Showing only changes of commit 94b7c7e7ba - Show all commits

View File

@@ -1,42 +0,0 @@
import {environment} from '../../environments/environment';
export class Logger {
private static inited = false;
static info(obj: object) {
this.printLogInfo();
if (environment.logger) {
// tslint:disable-next-line:no-console
console.info(obj);
}
}
static debug(obj: object) {
this.printLogInfo();
if (environment.logger) {
// tslint:disable-next-line:no-console
console.debug(obj);
}
}
static error(obj: object) {
this.printLogInfo();
if (environment.logger) {
// tslint:disable-next-line:no-console
console.error(obj);
}
}
static printLogInfo() {
const option = {
environment: environment.production ? 'release' : 'debug',
};
if (!this.inited) {
// tslint:disable-next-line:no-console
console.info(option);
this.inited = true;
}
}
}