DiscordTickets/src/logger.js

39 lines
1.3 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');
2021-02-27 23:13:46 +02:00
module.exports = new Logger({
debug: config.debug,
directory: path('./logs/'),
keepFor: config.logs.keep_for,
levels: {
2021-05-22 02:04:18 +03:00
_logger: { format: '&f&!7{timestamp}&r [LOGGER] {text}' },
basic: { format: '&f&!7{timestamp} {text}' },
2021-02-27 23:13:46 +02:00
commands: {
2021-05-22 02:04:18 +03:00
format: '&f&!7{timestamp}&r &3[INFO] &d(COMMANDS)&r {text}',
type: 'info'
2021-03-01 01:57:21 +02:00
},
2021-05-22 02:04:18 +03:00
console: { format: '&f&!7{timestamp} [INFO] {text}' },
debug: { format: '&f&!7{timestamp}&r &1[DEBUG] &9{text}' },
error: { format: '&f&!7{timestamp}&r &4[ERROR] &c{text}' },
2021-03-01 01:57:21 +02:00
http: {
2021-05-22 02:04:18 +03:00
format: '&f&!7{timestamp}&r &3[INFO] &d(HTTP)&r {text}',
type: 'info'
2021-03-01 01:57:21 +02:00
},
2021-05-22 02:04:18 +03:00
info: { format: '&f&!7{timestamp}&r &3[INFO] &b{text}' },
notice: { format: '&f&!7{timestamp}&r &0&!6[NOTICE] {text}' },
plugins: {
format: '&f&!7{timestamp}&r &3[INFO] &d(PLUGINS)&r {text}',
type: 'info'
},
success: { format: '&f&!7{timestamp}&r &2[SUCCESS] &a{text}' },
warn: { format: '&f&!7{timestamp}&r &6[WARN] &e{text}' },
2021-03-01 01:57:21 +02:00
ws: {
2021-05-22 02:04:18 +03:00
format: '&f&!7{timestamp}&r &3[INFO] &d(WS)&r {text}',
type: 'info'
2021-02-27 23:13:46 +02:00
}
2021-05-22 02:04:18 +03:00
},
logToFile: config.logs.enabled,
name: 'Discord Tickets by eartharoid',
splitFile: config.logs.split,
timestamp: 'YYYY-MM-DD HH:mm:ss'
2021-02-27 23:13:46 +02:00
});