@jin7942/ray
Version:
Lightweight CI/CD deployment tool powered by Docker and Git
27 lines (26 loc) • 730 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.setGlobalConfig = setGlobalConfig;
exports.getGlobalConfig = getGlobalConfig;
exports.getLogSettings = getLogSettings;
let configRef;
function setGlobalConfig(c) {
configRef = c;
}
function getGlobalConfig() {
if (!configRef)
throw new Error('Global config not set');
return configRef;
}
/**
* Returns extracted settings relevant to logging
*/
function getLogSettings() {
const config = getGlobalConfig();
const internal = config.internal ?? {};
return {
logDir: internal.logdir ?? 'logs',
maxSize: internal.maxLogDirSize ?? 5 * 1024 * 1024,
level: internal.logLevel ?? 'info',
};
}