Skip to content

CustomLogger

Danny edited this page Feb 24, 2022 · 2 revisions

You may use a different logger, for this project we did not include a common logging library due to how big they are in most cases, but if you need to use a different logging library, you can create a wrapper that implements the ILogger interface (exported by Turbo) and then map up the functions, an example of the custom logger structure:

class CustomLogger implements ILogger {
	public info(...args: any[]): void {
		console.log('customlogger::info', ...args);
	}

	public warn(...args: any[]): void {
		console.warn('customlogger::warn', ...args);
	}

	public error(...args: any[]): void {
		console.error('customlogger::error', ...args);
	}

	public verbose(...args: any[]): void {
		console.log('customlogger::verbose', ...args);
	}

	public debug(...args: any[]): void {
		console.log('customlogger::debug', ...args);
	}
}

Register logger

To register the logger with the engine, you can do the following:

import { Engine } from '@symbux/turbo';
import { CustomLogger } from './CustomLogger';

const engine = new Engine({
	// ...
	logger: new CustomLogger(),
	// ...
});

Features

Plugins

Future Plans

Resources

Clone this wiki locally