mirror of
https://github.com/darksaid98/cadence-discord-bot.git
synced 2026-12-02 06:28:54 +00:00
41 lines
1006 B
JavaScript
41 lines
1006 B
JavaScript
const pino = require('pino');
|
|
require('dotenv').config();
|
|
|
|
const transport = pino.transport({
|
|
targets: [
|
|
{
|
|
target: 'pino/file',
|
|
level: process.env.MINIMUM_LOG_LEVEL,
|
|
options: { destination: './app-all.log' }
|
|
},
|
|
{
|
|
target: 'pino/file',
|
|
level: 'debug',
|
|
options: { destination: './app-debug.log' }
|
|
},
|
|
{
|
|
target: 'pino/file',
|
|
level: 'info',
|
|
options: { destination: './app-info.log' }
|
|
},
|
|
{
|
|
target: 'pino/file',
|
|
level: 'error',
|
|
options: { destination: './app-error.log' }
|
|
},
|
|
{
|
|
level: process.env.MINIMUM_LOG_LEVEL_CONSOLE,
|
|
target: 'pino-pretty'
|
|
}
|
|
]
|
|
});
|
|
|
|
module.exports = pino(
|
|
{
|
|
level: process.env.MINIMUM_LOG_LEVEL,
|
|
timestamp: () => `,"timestamp":"${new Date(Date.now()).toISOString()}"`,
|
|
base: undefined
|
|
},
|
|
transport
|
|
);
|