chore: remove unused shared logger default export (#5380)

Integrated into release/v3.8.42
This commit is contained in:
Jan Leon
2026-06-30 00:15:10 +02:00
committed by GitHub
parent 8e8d08ea15
commit f2d7aa9303
2 changed files with 11 additions and 4 deletions

View File

@@ -171,5 +171,3 @@ export const logger = buildLogger();
export function createLogger(module: string) {
return logger.child({ module });
}
export default logger;

View File

@@ -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");
});