fix (backend): correctly fallback maxLogLevel to info
This commit is contained in:
parent
f80ee9f36d
commit
aae505ad68
1 changed files with 6 additions and 3 deletions
|
@ -47,8 +47,8 @@ export default class Logger {
|
||||||
return logger;
|
return logger;
|
||||||
}
|
}
|
||||||
|
|
||||||
private showThisLog(logLevel: Level, configLevel: string) {
|
private showThisLog(logLevel: Level, configMaxLevel: string) {
|
||||||
switch (configLevel) {
|
switch (configMaxLevel) {
|
||||||
case "error":
|
case "error":
|
||||||
return ["error"].includes(logLevel);
|
return ["error"].includes(logLevel);
|
||||||
case "warning":
|
case "warning":
|
||||||
|
@ -75,7 +75,10 @@ export default class Logger {
|
||||||
if (
|
if (
|
||||||
(config.maxLogLevel != null &&
|
(config.maxLogLevel != null &&
|
||||||
!this.showThisLog(level, config.maxLogLevel)) ||
|
!this.showThisLog(level, config.maxLogLevel)) ||
|
||||||
(config.logLevel != null && !config.logLevel.includes(level))
|
(config.logLevel != null && !config.logLevel.includes(level)) ||
|
||||||
|
(config.maxLogLevel == null &&
|
||||||
|
config.logLevel == null &&
|
||||||
|
!this.showThisLog(level, "info"))
|
||||||
)
|
)
|
||||||
return;
|
return;
|
||||||
if (!this.store) store = false;
|
if (!this.store) store = false;
|
||||||
|
|
Loading…
Reference in a new issue