Console / JSON Log transport for FIXParser
The fixparser-plugin-log-console plugin provides an easy way to log messages to the console in either a human-readable text or JSON format. It is designed to work seamlessly with the FIXParser TypeScript library, making it ideal for logging FIX message parsing activities.
FIXParser logging system.To install the plugin, ensure you have FIXParser installed, then run the following command:
``bash`
npm install fixparser-console-log
`typescript
import { ConsoleLogTransport } from 'fixparser-console-log';
import { Logger } from 'fixparser'; // Assuming Logger is part of FIXParser
// Create an instance of ConsoleLogTransport with the desired format
const consoleLogTransport = new ConsoleLogTransport({ format: 'json' });
// Add the transport to the logger
const logger = new Logger({ name: 'TestLogger', level: 'info', transport: consoleLogTransport });
`
The ConsoleLogTransport constructor accepts the following option:
- format: Specifies the output format of the logs. Choose from:
- 'console' (text format)'json'` (structured JSON format)
-