improve logging

This commit is contained in:
Asraelite 2016-03-28 11:13:19 +01:00
parent 9f2cbf2bce
commit ce5f5380e1
2 changed files with 36 additions and 22 deletions

View file

@ -9,6 +9,8 @@ const packageJson = require('../package.json');
class WingbaseServer extends ServerInterface {
constructor() {
super();
process.on('SIGINT', this.stop.bind(this));
}
start() {
@ -18,12 +20,13 @@ class WingbaseServer extends ServerInterface {
this.webServer.start();
this.gameServer.start();
this.log(`Wingbase version ${packageJson.version} running.`);
this.log(`Wingbase version ${packageJson.version} running.`, 'bold');
}
stop() {
this.log('Server stopping.');
process.exit();
this.log('Server stopping.', 'bold');
this.capLogfile();
setTimeout(process.exit, 100);
}
}