@sparkbot/plugin-logger-pino
v0.1.0
Published
The default logging library plugin for Spark⚡️Bot.
Downloads
1
Readme
Spark⚡️Bot - Pino logging library plugin
@sparkbot/plugin-logger-pino implements the pino logging library for Spark⚡️Bot project.
Usage
- Add the package to your project with
bun add @sparkbot/plugin-logger-pino
- Update
sparkbot.config.ts
. You will need to configure at least one transport.Please see the pino transport documentation for more information.
The below example uses the pino-pretty and pino-discord-webhook transports. You will need to add these packages if you want to use them.
@sparkbot/plugin-logger is already included in the Spark⚡️Bot codebase, and the package should not be removed as it contains necessary interfaces for all other plugins to operate.
To configure your Spark⚡️Bot to use @sparkbot/plugin-logger you need to update sparkbot.config.ts
, the level you set for logging level is the lowest type you want.
loggingLibraryPlugin: {
prod: {
module: '@sparkbot/plugin-logger-pino',
options: {
transports: [
{
target: 'pino-pretty',
options: {
colorize: true,
},
level: 'warn',
},
{
target: 'pino-discord-webhook',
options: {
webhookURL: URL Here but should be a *secret*,
},
level: 'error',
},
],
},
},
dev: {
module: '@sparkbot/plugin-logger-pino',
options: {
transports: [
{
target: 'pino-pretty',
options: {
colorize: true,
},
level: 'debug',
},
],
},
},
},