Fix logger
This commit is contained in:
parent
5f4abcec1f
commit
08460a923d
@ -120,27 +120,29 @@ class Logger {
|
|||||||
if (!this.conf.fileOptions.enabled || this.temp_disable) {
|
if (!this.conf.fileOptions.enabled || this.temp_disable) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (component.length ) {
|
if (Array.isArray(component) && component.length ) {
|
||||||
for (const c in component) {
|
for (const c of component) {
|
||||||
if (this.conf.fileOptions[component]) {
|
if (this.conf.fileOptions[c]) {
|
||||||
return this.conf.fileOptions[component];
|
return this.conf.fileOptions[c];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
return this.conf.fileOptions[component];
|
return this.conf.fileOptions[component];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
canLogConsole(component) {
|
canLogConsole(component) {
|
||||||
if (!this.conf.consoleOptions.enabled || this.temp_disable) {
|
if (!this.conf.consoleOptions.enabled || this.temp_disable) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (Array.isArray(component) && component.length) {
|
if (Array.isArray(component) && component.length) {
|
||||||
for (const c in component) {
|
for (const c of component) {
|
||||||
if (this.conf.consoleOptions[component]) {
|
if (this.conf.consoleOptions[c]) {
|
||||||
return this.conf.consoleOptions[component];
|
return this.conf.consoleOptions[c];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
return this.conf.consoleOptions[component];
|
return this.conf.consoleOptions[component];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// level is unused as of now, but this may change in the future
|
// level is unused as of now, but this may change in the future
|
||||||
|
Loading…
Reference in New Issue
Block a user