import { CommonCfg } from "./CommonCfg"; import { InheritableCfg, MessageEnvelope, OutputConfig, OutputLevelMap } from "./types"; export abstract class Output extends CommonCfg implements InheritableCfg { outputLevelMap: OutputLevelMap; // static defaultOutputFormatter: OutputFormatter = (env: MessageEnvelope, output: Output): any[] => { // return env.args; // } // outputFormatter: OutputFormatter = Output.defaultOutputFormatter; constructor(name: string, cfg: OutputConfig = {}, rootLogger?: InheritableCfg) { super(name, cfg, rootLogger); this.outputLevelMap = cfg.outputLevelMap || {}; // if (cfg.outputFormatter !== undefined) { // this.outputFormatter = cfg.outputFormatter; // } } getOutputLevel(loggerLevel: string): string { const levelMap: OutputLevelMap = this.outputLevelMap; return levelMap[loggerLevel] || loggerLevel; } abstract writeLog(env: MessageEnvelope): void; }