quick fix for when logging.file.enabled is false
This commit is contained in:
parent
42a47dbcb7
commit
ca66217be8
@ -196,15 +196,17 @@ export default {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Configure GadgetLog for this package
|
// Configure GadgetLog for this package
|
||||||
|
GadgetLog.consoleEnabled = yamlConfig.logging?.console?.enabled === true;
|
||||||
|
if (yamlConfig.logging?.file?.enabled === true) {
|
||||||
const logFileOptions = {
|
const logFileOptions = {
|
||||||
basePath: yamlConfig.logging?.file?.path
|
basePath: yamlConfig.logging.file.path
|
||||||
? resolvePath(yamlConfig.logging.file.path)
|
? resolvePath(yamlConfig.logging.file.path)
|
||||||
: path.join(INSTALL_DIR, "logs"),
|
: path.join(INSTALL_DIR, "logs"),
|
||||||
name: yamlConfig.logging?.file?.name || "gadget-code",
|
name: yamlConfig.logging.file.name || "gadget-code",
|
||||||
maxWritesPerFile: yamlConfig.logging?.file?.maxWritesPerFile || 10000,
|
maxWritesPerFile: yamlConfig.logging.file.maxWritesPerFile || 10000,
|
||||||
maxFiles: yamlConfig.logging?.file?.maxFiles || 10,
|
maxFiles: yamlConfig.logging.file.maxFiles || 10,
|
||||||
};
|
};
|
||||||
const defaultLogFile = new GadgetLogFile(logFileOptions);
|
const defaultLogFile = new GadgetLogFile(logFileOptions);
|
||||||
defaultLogFile.open();
|
defaultLogFile.open();
|
||||||
GadgetLog.consoleEnabled = yamlConfig.logging?.console?.enabled === true;
|
GadgetLog.defaultFile = defaultLogFile;
|
||||||
GadgetLog.defaultFile = yamlConfig.logging?.file?.enabled === true ? defaultLogFile : undefined;
|
}
|
||||||
|
|||||||
@ -76,17 +76,19 @@ export default {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Configure GadgetLog for this package
|
// Configure GadgetLog for this package
|
||||||
|
GadgetLog.consoleEnabled = yamlConfig.logging?.console?.enabled === true;
|
||||||
|
if (yamlConfig.logging?.file?.enabled === true) {
|
||||||
const logFileOptions = {
|
const logFileOptions = {
|
||||||
basePath: yamlConfig.logging?.file?.path
|
basePath: yamlConfig.logging.file.path
|
||||||
? resolvePath(yamlConfig.logging.file.path)
|
? resolvePath(yamlConfig.logging.file.path)
|
||||||
: path.join(INSTALL_DIR, "logs"),
|
: path.join(INSTALL_DIR, "logs"),
|
||||||
name: yamlConfig.logging?.file?.name || "gadget-drone",
|
name: yamlConfig.logging.file.name || "gadget-drone",
|
||||||
maxWritesPerFile: yamlConfig.logging?.file?.maxWritesPerFile || 10000,
|
maxWritesPerFile: yamlConfig.logging.file.maxWritesPerFile || 10000,
|
||||||
maxFiles: yamlConfig.logging?.file?.maxFiles || 10,
|
maxFiles: yamlConfig.logging.file.maxFiles || 10,
|
||||||
};
|
};
|
||||||
const defaultLogFile = new GadgetLogFile(logFileOptions);
|
const defaultLogFile = new GadgetLogFile(logFileOptions);
|
||||||
defaultLogFile.open();
|
defaultLogFile.open();
|
||||||
GadgetLog.consoleEnabled = yamlConfig.logging?.console?.enabled === true;
|
GadgetLog.defaultFile = defaultLogFile;
|
||||||
GadgetLog.defaultFile = yamlConfig.logging?.file?.enabled === true ? defaultLogFile : undefined;
|
}
|
||||||
|
|
||||||
/* eslint-enable no-process-env */
|
/* eslint-enable no-process-env */
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user