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.
- Output logs in either plain text or JSON format.
- Supports dynamic format configuration after initialization.
- Simple integration with
FIXParser
logging system.
To install the plugin, ensure you have FIXParser
installed, then run the following command:
npm install fixparser-console-log
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)
-
This project is licensed under a Commercial License - see the LICENSE file for details.