From 27e0a7632791d5ff0f41dc10e91cd73747b752f8 Mon Sep 17 00:00:00 2001 From: Rahul Sethi <5822355+RamIdeas@users.noreply.github.com> Date: Fri, 17 Nov 2023 15:21:54 +0000 Subject: [PATCH] log debug-log-file location to terminal on exit as well as on startup --- packages/wrangler/src/utils/debug-log-file.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/wrangler/src/utils/debug-log-file.ts b/packages/wrangler/src/utils/debug-log-file.ts index 9c1cffb91d244..ea95833974e9d 100644 --- a/packages/wrangler/src/utils/debug-log-file.ts +++ b/packages/wrangler/src/utils/debug-log-file.ts @@ -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"; @@ -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}"`); + }); } /**