Skip to content

Commit

Permalink
prevent all logs when terminal closes
Browse files Browse the repository at this point in the history
  • Loading branch information
brandenrodgers committed Nov 14, 2023
1 parent 79ab97a commit 028297e
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions packages/cli/lib/process.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const readline = require('readline');
const { logger } = require('@hubspot/cli-lib/logger');
const { logger, setLogLevel, LOG_LEVEL } = require('@hubspot/cli-lib/logger');

const handleExit = callback => {
const terminationSignals = [
Expand All @@ -21,7 +21,14 @@ const handleExit = callback => {
// Prevent duplicate exit handling
if (!exitInProgress) {
exitInProgress = true;
await callback({ isSIGHUP: signal === 'SIGHUP' });
const isSIGHUP = 'SIGHUP';

// Prevent logs when terminal closes
if (isSIGHUP) {
setLogLevel(LOG_LEVEL.NONE);
}

await callback({ isSIGHUP });
}
});
});
Expand Down

0 comments on commit 028297e

Please sign in to comment.