Fixed setLogLevel to affect global logging.
This commit is contained in:
parent
f61f34bfb2
commit
ac51a88c29
@ -151,15 +151,6 @@ export class Logger {
|
||||
});
|
||||
}
|
||||
|
||||
setLogLevel(logLevel: LogLevel): void {
|
||||
const level = LogLevels[logLevel];
|
||||
if (level == null) {
|
||||
this.warn("invalid log level - " + logLevel);
|
||||
return;
|
||||
}
|
||||
LogLevel = level;
|
||||
}
|
||||
|
||||
_log(logLevel: LogLevel, args: Array<any>): void {
|
||||
if (LogLevel > LogLevels[logLevel]) { return; }
|
||||
console.log.apply(console, args);
|
||||
@ -318,4 +309,13 @@ export class Logger {
|
||||
_censorErrors = !!censorship;
|
||||
_permanentCensorErrors = !!permanent;
|
||||
}
|
||||
|
||||
static setLogLevel(logLevel: LogLevel): void {
|
||||
const level = LogLevels[logLevel];
|
||||
if (level == null) {
|
||||
Logger.globalLogger().warn("invalid log level - " + logLevel);
|
||||
return;
|
||||
}
|
||||
LogLevel = level;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user