Skip to content

Commit

Permalink
fixup! Add loggerFinishAndExit for log file consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
yuqu committed May 18, 2020
1 parent 985c7a4 commit 528d052
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/util/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ fileTransport.on("open", () => {
});
});

const waitForLoggerFinish = (): Promise<never> => new Promise((resolve): void => {
const finishLogger = (): Promise<never> => new Promise((resolve): void => {
fileLogWatcher.on("finish", (): void => {
resolve();
});
Expand All @@ -59,5 +59,5 @@ const waitForLoggerFinish = (): Promise<never> => new Promise((resolve): void =>

export default logger;
export {
waitForLoggerFinish
finishLogger
};
4 changes: 2 additions & 2 deletions src/util/process.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { waitForLoggerFinish } from "./logger";
import { finishLogger } from "./logger";

const gracefulExit = async (exitCode = 0): Promise<never> => {
await waitForLoggerFinish();
await finishLogger();
process.exit(exitCode);
};

Expand Down

0 comments on commit 528d052

Please sign in to comment.