improve logging
This commit is contained in:
parent
9f2cbf2bce
commit
ce5f5380e1
2 changed files with 36 additions and 22 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue