Ensure things don't crash on undefined settings
This commit is contained in:
parent
0eb3840221
commit
355108e0ef
@ -1,6 +1,5 @@
|
||||
import currentBrowser from '../conf/BrowserDetect';
|
||||
import { decycle } from 'json-cyclic';
|
||||
import { sleep } from '../../common/js/utils';
|
||||
|
||||
class Logger {
|
||||
constructor(options) {
|
||||
@ -376,10 +375,10 @@ class Logger {
|
||||
|
||||
// skip all checks if we force log
|
||||
if (level === 'force') {
|
||||
if (this.conf.fileOptions.enabled) {
|
||||
if (this.conf.fileOptions?.enabled) {
|
||||
this.logToFile(message, stackInfo);
|
||||
}
|
||||
if (this.conf.consoleOptions.enabled) {
|
||||
if (this.conf.consoleOptions?.enabled) {
|
||||
this.logToConsole(message, stackInfo);
|
||||
}
|
||||
return; // don't check further — recursion-land ahead!
|
||||
@ -394,12 +393,12 @@ class Logger {
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.conf.fileOptions.enabled) {
|
||||
if (this.conf.fileOptions?.enabled) {
|
||||
if (this.canLogFile(component) || stackInfo.exitLogs) {
|
||||
this.logToFile(message, stackInfo);
|
||||
}
|
||||
}
|
||||
if (this.conf.consoleOptions.enabled) {
|
||||
if (this.conf.consoleOptions?.enabled) {
|
||||
if (this.canLogConsole(component) || stackInfo.exitLogs) {
|
||||
this.logToConsole(message, stackInfo);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user