Skip to content

Commit

Permalink
Fixed setLogLevel to affect global logging.
Browse files Browse the repository at this point in the history
  • Loading branch information
ricmoo committed Feb 25, 2020
1 parent f61f34b commit ac51a88
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions packages/logger/src.ts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
}
}

0 comments on commit ac51a88

Please sign in to comment.