From f2d7aa930312de0abc985971e44a803effb3bf1a Mon Sep 17 00:00:00 2001 From: Jan Leon Date: Tue, 30 Jun 2026 00:15:10 +0200 Subject: [PATCH] chore: remove unused shared logger default export (#5380) Integrated into release/v3.8.42 --- src/shared/utils/logger.ts | 2 -- tests/unit/logger-redaction-wiring.test.ts | 13 +++++++++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/shared/utils/logger.ts b/src/shared/utils/logger.ts index c4db37a8e7..ff71dd6be5 100644 --- a/src/shared/utils/logger.ts +++ b/src/shared/utils/logger.ts @@ -171,5 +171,3 @@ export const logger = buildLogger(); export function createLogger(module: string) { return logger.child({ module }); } - -export default logger; diff --git a/tests/unit/logger-redaction-wiring.test.ts b/tests/unit/logger-redaction-wiring.test.ts index 09d855a4a9..8424356980 100644 --- a/tests/unit/logger-redaction-wiring.test.ts +++ b/tests/unit/logger-redaction-wiring.test.ts @@ -12,7 +12,8 @@ process.env.APP_LOG_TO_FILE = "true"; process.env.APP_LOG_FILE_PATH = logFile; process.env.APP_LOG_LEVEL = "debug"; -const { createLogger } = await import("../../src/shared/utils/logger.ts"); +const loggerModule = await import("../../src/shared/utils/logger.ts"); +const { createLogger } = loggerModule; /** Poll the (worker-thread-written) log file until the predicate holds or timeout. */ async function readLogWhen( @@ -38,10 +39,18 @@ test("logger redacts a Bearer secret in a free-form message and an error stack ( log.error({ err }, "request failed"); const contents = await readLogWhen( - (c) => c.includes("[REDACTED]") && !c.includes("sk-superSecretKey") && !c.includes("sk-anotherSecret") + (c) => + c.includes("[REDACTED]") && + !c.includes("sk-superSecretKey") && + !c.includes("sk-anotherSecret") ); assert.match(contents, /\[REDACTED\]/, "redaction marker must appear in the log output"); assert.doesNotMatch(contents, /sk-superSecretKey/, "message secret must be redacted"); assert.doesNotMatch(contents, /sk-anotherSecret/, "error-stack secret must be redacted"); }); + +test("shared logger module exposes named logger helpers", () => { + assert.equal(typeof loggerModule.logger.info, "function"); + assert.equal(typeof loggerModule.createLogger, "function"); +});