mirror of
https://codeberg.org/yeentown/barkey.git
synced 2025-08-21 10:33:37 +00:00
add additional process exit loggers
This commit is contained in:
parent
0a56ce92ca
commit
3ce5471414
1 changed files with 19 additions and 1 deletions
|
@ -73,8 +73,26 @@ async function main() {
|
||||||
}));
|
}));
|
||||||
|
|
||||||
// Dying away...
|
// Dying away...
|
||||||
|
process.on('disconnect', () => {
|
||||||
|
try {
|
||||||
|
logger.warn('IPC channel disconnected! The process may soon die.');
|
||||||
|
} catch {
|
||||||
|
console.warn('IPC channel disconnected! The process may soon die.');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
process.on('beforeExit', code => {
|
||||||
|
try {
|
||||||
|
logger.warn(`Event loop died! Process will exit with code ${code}.`);
|
||||||
|
} catch {
|
||||||
|
console.warn(`Event loop died! Process will exit with code ${code}.`);
|
||||||
|
}
|
||||||
|
});
|
||||||
process.on('exit', code => {
|
process.on('exit', code => {
|
||||||
logger.info(`The process is going to exit with code ${code}`);
|
try {
|
||||||
|
logger.info(`The process is going to exit with code ${code}`);
|
||||||
|
} catch {
|
||||||
|
console.info(`The process is going to exit with code ${code}`);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
//#endregion
|
//#endregion
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue