{
  "version": 3,
  "sources": ["../../src/ConsoleLogTransport.ts"],
  "sourcesContent": ["import type { ILogTransporter, LogMessage } from 'fixparser-common';\n\n/**\n * Logger output format options.\n *\n * - 'console': Output log in plain text format\n * - 'json': Output log in JSON format\n *\n * @public\n */\nexport type ConsoleFormat = 'console' | 'json';\n\n/**\n * A LogTransporter implementation for logging to the console.\n * It supports both text (console) and JSON formats.\n */\nexport class ConsoleLogTransport implements ILogTransporter {\n    private format: ConsoleFormat;\n\n    constructor({ format = 'json' }: { format: ConsoleFormat }) {\n        this.format = format;\n    }\n\n    /**\n     * Configures the format for console logging (either 'console' for text or 'json').\n     */\n    configure(config: { format: 'console' | 'json' }): void {\n        this.format = config.format || 'json';\n    }\n\n    /**\n     * Sends the log message to the console in the configured format.\n     */\n    async send(log: LogMessage): Promise<void> {\n        if (this.format === 'json') {\n            console.log(JSON.stringify(log));\n        } else {\n            const { name, id, message, level, ...additionalProperties } = log;\n            const kv = Object.entries(additionalProperties).map(([key, value]) => `${key}: ${value}`);\n            let logMessage = '';\n            if (name) {\n                logMessage += `${name} `;\n            }\n            logMessage += `${id}: ${message}`;\n            console.log(logMessage, kv.join(', '));\n        }\n    }\n\n    /**\n     * Flushes the log buffer (if any buffering mechanism exists).\n     */\n    async flush(): Promise<void> {\n        // No flushing needed for console transport\n    }\n\n    /**\n     * Closes the transport (not needed for console, but keeping the method for consistency).\n     */\n    async close(): Promise<void> {\n        // No close logic needed for console transport\n    }\n\n    /**\n     * Returns the status of the transport (always \"connected\" for console).\n     */\n    status(): string {\n        return 'connected';\n    }\n}\n"],
  "mappings": ";AAgBO,IAAM,sBAAN,MAAqD;AAAA,EAChD;AAAA,EAER,YAAY,EAAE,SAAS,OAAO,GAA8B;AACxD,SAAK,SAAS;AAAA,EAClB;AAAA;AAAA;AAAA;AAAA,EAKA,UAAU,QAA8C;AACpD,SAAK,SAAS,OAAO,UAAU;AAAA,EACnC;AAAA;AAAA;AAAA;AAAA,EAKA,MAAM,KAAK,KAAgC;AACvC,QAAI,KAAK,WAAW,QAAQ;AACxB,cAAQ,IAAI,KAAK,UAAU,GAAG,CAAC;AAAA,IACnC,OAAO;AACH,YAAM,EAAE,MAAM,IAAI,SAAS,OAAO,GAAG,qBAAqB,IAAI;AAC9D,YAAM,KAAK,OAAO,QAAQ,oBAAoB,EAAE,IAAI,CAAC,CAAC,KAAK,KAAK,MAAM,GAAG,GAAG,KAAK,KAAK,EAAE;AACxF,UAAI,aAAa;AACjB,UAAI,MAAM;AACN,sBAAc,GAAG,IAAI;AAAA,MACzB;AACA,oBAAc,GAAG,EAAE,KAAK,OAAO;AAC/B,cAAQ,IAAI,YAAY,GAAG,KAAK,IAAI,CAAC;AAAA,IACzC;AAAA,EACJ;AAAA;AAAA;AAAA;AAAA,EAKA,MAAM,QAAuB;AAAA,EAE7B;AAAA;AAAA;AAAA;AAAA,EAKA,MAAM,QAAuB;AAAA,EAE7B;AAAA;AAAA;AAAA;AAAA,EAKA,SAAiB;AACb,WAAO;AAAA,EACX;AACJ;",
  "names": []
}
