Permalink
Browse files

Reset process.title in process.on to prevent corrupt output

  • Loading branch information...
1 parent 92fc73b commit 30e8673c220b369fb0ce5c948a468789cd95a923 @smfreegard smfreegard committed Nov 19, 2012
Showing with 4 additions and 2 deletions.
  1. +4 −2 haraka.js
View
6 haraka.js
@@ -40,13 +40,15 @@ process.on('uncaughtException', function (err) {
['SIGTERM', 'SIGINT'].forEach(function (sig) {
process.on(sig, function () {
- logger.logcrit(sig + ' received');
+ process.title = path.basename(process.argv[1], '.js');
+ logger.loginfo(sig + ' received');
logger.dump_logs(1);
});
});
process.on('exit', function() {
- logger.logcrit('Shutting down');
+ process.title = path.basename(process.argv[1], '.js');
+ logger.loginfo('Shutting down');
logger.dump_logs();
});

0 comments on commit 30e8673

Please sign in to comment.