import { CommonCfg } from "./CommonCfg"; export interface ContextValues extends Record {}; export interface OutputLevelMap extends Record {}; export interface CommonConfig { name?: string; context?: ContextValues; logLevel?: string, enabled?: boolean, debugVar?: string, } export interface GlobalConfig extends CommonConfig { logLevels: string[]; } export interface OutputConfig extends CommonConfig { // outputFormatter?: OutputFormatter; outputLevelMap?: OutputLevelMap; // map from loglevels to whatever your output wants } export interface InheritableCfg { parent?: InheritableCfg | undefined; getConfig(): GlobalConfig; getChild(name: string, cfg?: CommonConfig); } export interface MessageEnvelope { logger: string, level: string, ctx: ContextValues, args: any[], } // TODO fix any type here export type MessageFormatter = (messageArgs: any[]) => any[]; export type NamedLogger = { cfg: CommonCfg, out: any, }