UNPKG

fixparser-plugin-log-console

Version:

Console / JSON logger for FIXParser

45 lines (44 loc) 1.23 kB
import type { ILogTransporter, LogMessage } from 'fixparser-common'; /** * Logger output format options. * * - 'console': Output log in plain text format * - 'json': Output log in JSON format * * @public */ export type ConsoleFormat = 'console' | 'json'; /** * A LogTransporter implementation for logging to the console. * It supports both text (console) and JSON formats. */ export declare class ConsoleLogTransport implements ILogTransporter { private format; constructor({ format, }: { format: ConsoleFormat; }); /** * Configures the format for console logging (either 'console' for text or 'json'). */ configure(config: { format: 'console' | 'json'; }): void; /** * Sends the log message to the console in the configured format. */ send(log: LogMessage): Promise<void>; /** * Flushes the log buffer (if any buffering mechanism exists). */ flush(): Promise<void>; /** * Closes the transport (not needed for console, but keeping the method for consistency). */ close(): Promise<void>; /** * Returns the status of the transport (always "connected" for console). */ status(): string; }