forked from Galactic/galactic-bot
move process error listener to logger
This commit is contained in:
parent
82d3b9392b
commit
6d2d1fec72
6
index.js
6
index.js
@ -2,8 +2,4 @@ const Manager = require('./Manager.js');
|
||||
const options = require('./options.json');
|
||||
|
||||
new Manager(options)
|
||||
.build();
|
||||
|
||||
process.on("unhandledRejection", (error) => {
|
||||
console.error("Unhandled promise rejection:", error); //eslint-disable-line no-console
|
||||
});
|
||||
.build();
|
@ -39,7 +39,11 @@ class Logger {
|
||||
//TODO: Add proper date-oriented filenames and add a daily rotation file (?).
|
||||
|
||||
this.shardManager
|
||||
.on('shardCreate', (shard) => this.write('debug', "Shard created.", shard));
|
||||
.on('shardCreate', (shard) => this.write('info', "Shard created.", shard));
|
||||
|
||||
process.on("unhandledRejection", (error) => {
|
||||
this.write('error', `Unhandled promise rejection:\n${error.stack}`); //eslint-disable-line no-console
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user