Skip to content

Commit

Permalink
fix(logger/setUpLogFile): Remove close event which was causing the wr…
Browse files Browse the repository at this point in the history
…ite stream to be reset to null when it shouldn't be
  • Loading branch information
JayPaulinCodes committed Mar 7, 2024
1 parent 781d53a commit 1a9e971
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/classes/Logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ export class Logger {
const filePath = this.options.output.file.outputDirectory + fileName;
const oldStream = this.writeStream;
const newStream = createWriteStream(filePath, { flags: "wx", encoding: "utf8" });
this.writeStream = null;

// Wait for the new file to open
newStream.on("open", () => {
Expand All @@ -106,10 +107,6 @@ export class Logger {
oldStream.end();
}
});

newStream.once("close", () => {
this.writeStream = null;
});

return;
}
Expand Down

0 comments on commit 1a9e971

Please sign in to comment.