forked from embee/woomy
removed fatal level
This commit is contained in:
parent
9bd67779ec
commit
abab09546c
4 changed files with 6 additions and 7 deletions
4
index.js
4
index.js
|
@ -53,7 +53,7 @@ const init = async () => {
|
|||
// Command handler
|
||||
fs.readdir('./commands', (err, files) => {
|
||||
if (err) {
|
||||
client.logger.fatal('Failed to get files in commands directory: ' + err)
|
||||
client.logger.error('Failed to get files in commands directory: ' + err)
|
||||
process.exit()
|
||||
}
|
||||
client.logger.info(`Loading ${files.length} commands.`)
|
||||
|
@ -71,7 +71,7 @@ const init = async () => {
|
|||
// Event handler
|
||||
fs.readdir('./events', (err, files) => {
|
||||
if (err) {
|
||||
client.logger.fatal('Failed to get files in events directory: ' + err)
|
||||
client.logger.error('Failed to get files in events directory: ' + err)
|
||||
process.exit()
|
||||
}
|
||||
client.logger.info(`Loading ${files.length} events.`)
|
||||
|
|
|
@ -278,7 +278,7 @@ module.exports = client => {
|
|||
// Both of these functions catch errors and log them (maybe we could use sentry?)
|
||||
process.on('uncaughtException', (err) => {
|
||||
const errorMsg = err.stack.replace(new RegExp(`${__dirname}/`, 'g'), './')
|
||||
client.logger.fatal(`Uncaught Exception: ${errorMsg}`)
|
||||
client.logger.error(`Uncaught Exception: ${errorMsg}`)
|
||||
process.exit(1)
|
||||
})
|
||||
|
||||
|
|
|
@ -12,12 +12,11 @@ const logger = colorConsole({
|
|||
info: `{{timestamp}} | ${'{{title}}'.cyan} | {{file}} | {{message}}`,
|
||||
ready: `{{timestamp}} | ${'{{title}}'.green} | {{file}} | {{message}}`,
|
||||
warn: `{{timestamp}} | ${'{{title}}'.yellow} | {{file}} | {{message}}`,
|
||||
error: `{{timestamp}} | ${'{{title}}'.red} | {{file}} | {{message}}`,
|
||||
fatal: `{{timestamp}} | ${'{{title}}'.red.bold} | {{file}} | {{message}}`
|
||||
error: `{{timestamp}} | ${'{{title}}'.red} | {{file}} | {{message}}`
|
||||
}
|
||||
],
|
||||
dateformat: 'yyyy-mm-dd"T"HH:MM:ss',
|
||||
methods: ['cmd', 'debug', 'info', 'ready', 'warn', 'error', 'fatal'],
|
||||
methods: ['cmd', 'debug', 'info', 'ready', 'warn', 'error'],
|
||||
filters: [colors.white]
|
||||
})
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ module.exports = {
|
|||
mongoose.set('useFindAndModify', false)
|
||||
mongoose.Promise = global.Promise
|
||||
} catch (err) {
|
||||
client.logger.fatal(`Could not connect to the database:\n ${err.stack}`)
|
||||
client.logger.error(`Could not connect to the database:\n ${err.stack}`)
|
||||
}
|
||||
|
||||
mongoose.connection.on('connected', () => {
|
||||
|
|
Loading…
Reference in a new issue