This repository contains both official and hosted plugins to integrate various logging libraries into Spark⚡️Bot.
- @sparkbot/logger-console - Default logging library plugin, logs using console methods.
- @sparkbot/logger-pino - Plugin for the pino logging library.
We would love to have plugins for other libraries created. You can either add it to this repository or create your own package, either way, please open a PR here to include it.
The readme for each plugin will have detailed instructions on its use. In general you will need to add the plugin using bun add
and then edit sparkbot.config.ts
with the package name and any required options.
Creating a logger plugin requires extending the LoggerPlugin interface class and exporting with the name Logger.
export class Logger extends LoggerPlugin {}
The error()
, warn()
, info()
, and debug()
methods must be implemented. Your plugin should provide some mechanism that allows the developer to determine what level of logging to emit.
Looking at the official plugins would be a good starting place for understanding how the plugins operate.