Skip to content

Commit

Permalink
log debug-log-file location to terminal on exit
Browse files Browse the repository at this point in the history
as well as on startup
  • Loading branch information
RamIdeas committed Nov 17, 2023
1 parent b7d958d commit 27e0a76
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/wrangler/src/utils/debug-log-file.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { appendFile, mkdir, readFile } from "node:fs/promises";
import path from "node:path";
import { Mutex } from "miniflare";
import onExit from "signal-exit";
import { getEnvironmentVariableFactory } from "../environment-variables/factory";
import { getBasePath } from "../paths";
import type { LoggerLevel } from "../logger";
Expand Down Expand Up @@ -69,7 +70,9 @@ ${message}
hasLoggedLocation = true;
const relativeFilepath = path.relative(process.cwd(), debugLogFilepath);
console.info(`🐛 Writing debug logs to "${relativeFilepath}"`);
// TODO: move this into an exit hook so it isn't the first thing logged
onExit(() => {
console.info(`🐛 Debug logs were written to "${relativeFilepath}"`);
});
}

/**
Expand Down

0 comments on commit 27e0a76

Please sign in to comment.