import { CommonCfg } from "./CommonCfg"; import { CommonConfig, GlobalConfig, InheritableCfg } from './types'; export class RootCfg extends CommonCfg implements InheritableCfg { logLevels: string[]; // #isRoot: boolean = true; constructor(cfg: GlobalConfig) { super('root', cfg); this.logLevels = cfg.logLevels; if (!cfg.logLevel) { this.setLogLevel(cfg.logLevels[cfg.logLevels.length - 1]) // this.logLevel = cfg.logLevels[cfg.logLevels.length - 1]; } if (!cfg.enabled) { cfg.enabled = true; } } // getChild(name, cfg?: CommonConfig): CommonCfg { // return new CommonCfg(name, cfg, this); // } setConfig(newConfig: GlobalConfig, replace: boolean = false) { super.setConfig(newConfig, replace); if (newConfig.logLevels) { this.logLevels = newConfig.logLevels; } } }