Skip to content

Commit

Permalink
refactor: simplify 'setExitOrCallback()' logging
Browse files Browse the repository at this point in the history
  • Loading branch information
honzajavorek committed Feb 1, 2019
1 parent aea95c7 commit 67b6b2e
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions lib/CLI.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,24 +79,21 @@ Example:

if (this.exit) {
this._processExit = (exitStatus) => {
logger.debug(`Exiting Dredd process with status '${exitStatus}'.`);
logger.debug('Using configured custom exit() method to terminate the Dredd process.');
logger.debug(`Using configured custom exit() method to terminate the Dredd process with status '${exitStatus}'.`);
this.finished = true;
this.stopServer(() => {
this.exit(exitStatus);
});
};
} else {
this._processExit = (exitStatus) => {
logger.debug(`Exiting Dredd process with status '${exitStatus}'.`);
logger.debug('Using native process.exit() method to terminate the Dredd process.');
logger.debug(`Using native process.exit() method to terminate the Dredd process with status '${exitStatus}'.`);
this.stopServer(() => process.exit(exitStatus));
};
}
} else {
this._processExit = (exitStatus) => {
logger.debug(`Exiting Dredd process with status '${exitStatus}'.`);
logger.debug('Using configured custom callback to terminate the Dredd process.');
logger.debug(`Using configured custom callback to terminate the Dredd process with status '${exitStatus}'.`);
this.finished = true;
if (this.sigIntEventAdded) {
if (this.serverProcess && !this.serverProcess.terminated) {
Expand Down

0 comments on commit 67b6b2e

Please sign in to comment.