Fix logging levels
This commit is contained in:
parent
a94d683293
commit
d605ee07f2
|
@ -18,7 +18,7 @@ export class Logger {
|
||||||
}
|
}
|
||||||
|
|
||||||
public log(text?: any, args?: any): void {
|
public log(text?: any, args?: any): void {
|
||||||
if (this.isMainFunction || this._logLevel === 0) {
|
if (this.isMainFunction || this._logLevel > 2) {
|
||||||
args
|
args
|
||||||
? console.log(this._main + text, args)
|
? console.log(this._main + text, args)
|
||||||
: console.log(this._main + text);
|
: console.log(this._main + text);
|
||||||
|
@ -26,7 +26,7 @@ export class Logger {
|
||||||
}
|
}
|
||||||
|
|
||||||
public warn(text?: any, args?: any): void {
|
public warn(text?: any, args?: any): void {
|
||||||
if (this._logLevel === 1) {
|
if (this._logLevel > 1) {
|
||||||
args
|
args
|
||||||
? console.warn(this._main + this._wrn + text, args)
|
? console.warn(this._main + this._wrn + text, args)
|
||||||
: console.warn(this._main + this._wrn + text);
|
: console.warn(this._main + this._wrn + text);
|
||||||
|
@ -34,11 +34,9 @@ export class Logger {
|
||||||
}
|
}
|
||||||
|
|
||||||
public error(text?: any, args?: any): void {
|
public error(text?: any, args?: any): void {
|
||||||
if (this._logLevel === 2) {
|
args
|
||||||
args
|
? console.error(this._main + this._err + text, args)
|
||||||
? console.error(this._main + this._err + text, args)
|
: console.error(this._main + this._err + text);
|
||||||
: console.error(this._main + this._err + text);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue