diff --git a/index.js b/index.js index c05f5c9..45d4e76 100644 --- a/index.js +++ b/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.`) diff --git a/utils/_functions.js b/utils/_functions.js index 1561679..eb569b9 100644 --- a/utils/_functions.js +++ b/utils/_functions.js @@ -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) }) diff --git a/utils/logger.js b/utils/logger.js index 047abc6..a220e45 100644 --- a/utils/logger.js +++ b/utils/logger.js @@ -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] }) diff --git a/utils/mongoose.js b/utils/mongoose.js index af45541..6db6564 100644 --- a/utils/mongoose.js +++ b/utils/mongoose.js @@ -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', () => {