DiscordTickets/src/logger.js

61 lines
1.4 KiB
JavaScript
Raw Normal View History

2021-02-27 23:13:46 +02:00
const { path } = require('./utils/fs');
const config = require('../user/config');
const Logger = require('leekslazylogger-fastify');
module.exports = new Logger({
2021-03-15 23:12:58 +02:00
name: 'Discord Tickets by eartharoid',
2021-02-27 23:13:46 +02:00
debug: config.debug,
logToFile: config.logs.enabled,
splitFile: config.logs.split,
2021-02-27 23:13:46 +02:00
directory: path('./logs/'),
keepFor: config.logs.keep_for,
2021-03-29 01:49:36 +03:00
timestamp: 'YYYY-MM-DD HH:mm:ss',
2021-02-27 23:13:46 +02:00
levels: {
_logger: {
2021-03-29 01:49:36 +03:00
format: '&f&!7{timestamp}&r [LOGGER] {text}'
2021-02-27 23:13:46 +02:00
},
basic: {
2021-03-29 01:49:36 +03:00
format: '&f&!7{timestamp} {text}'
2021-02-27 23:13:46 +02:00
},
console: {
2021-03-29 01:49:36 +03:00
format: '&f&!7{timestamp} [INFO] {text}'
2021-02-27 23:13:46 +02:00
},
info: {
2021-03-29 01:49:36 +03:00
format: '&f&!7{timestamp}&r &3[INFO] &b{text}'
2021-02-27 23:13:46 +02:00
},
success: {
2021-03-29 01:49:36 +03:00
format: '&f&!7{timestamp}&r &2[SUCCESS] &a{text}'
2021-02-27 23:13:46 +02:00
},
debug: {
2021-03-29 01:49:36 +03:00
format: '&f&!7{timestamp}&r &1[DEBUG] &9{text}'
2021-02-27 23:13:46 +02:00
},
notice: {
2021-03-29 01:49:36 +03:00
format: '&f&!7{timestamp}&r &0&!6[NOTICE] {text}'
2021-02-27 23:13:46 +02:00
},
warn: {
2021-03-29 01:49:36 +03:00
format: '&f&!7{timestamp}&r &6[WARN] &e{text}'
2021-02-27 23:13:46 +02:00
},
error: {
2021-03-29 01:49:36 +03:00
format: '&f&!7{timestamp}&r &4[ERROR] &c{text}'
2021-02-27 23:13:46 +02:00
},
commands: {
type: 'info',
2021-03-29 01:49:36 +03:00
format: '&f&!7{timestamp}&r &3[INFO] &d(COMMANDS)&r {text}'
2021-02-27 23:13:46 +02:00
},
plugins: {
type: 'info',
2021-03-29 01:49:36 +03:00
format: '&f&!7{timestamp}&r &3[INFO] &d(PLUGINS)&r {text}'
2021-02-27 23:13:46 +02:00
},
tickets: {
type: 'info',
2021-03-29 01:49:36 +03:00
format: '&f&!7{timestamp}&r &3[INFO] &d(TICKETS)&r {text}'
2021-03-01 01:57:21 +02:00
},
http: {
type: 'info',
2021-03-29 01:49:36 +03:00
format: '&f&!7{timestamp}&r &3[INFO] &d(HTTP)&r {text}'
2021-03-01 01:57:21 +02:00
},
ws: {
type: 'info',
2021-03-29 01:49:36 +03:00
format: '&f&!7{timestamp}&r &3[INFO] &d(WS)&r {text}'
2021-02-27 23:13:46 +02:00
}
}
});