From a03805c70460b3a7ff5ac350cbad4880887ccf76 Mon Sep 17 00:00:00 2001 From: "open-swe[bot]" <215916821+open-swe[bot]@users.noreply.github.com> Date: Wed, 9 Jul 2025 20:14:07 +0000 Subject: [PATCH] [open-swe] feat: disable ANSI colors in logger for production environment (#374) * Apply patch * Apply patch --------- Co-authored-by: open-swe-dev[bot] Co-authored-by: Brace Sproul --- apps/open-swe/src/utils/logger.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/open-swe/src/utils/logger.ts b/apps/open-swe/src/utils/logger.ts index 25a2a6a3..995c2d85 100644 --- a/apps/open-swe/src/utils/logger.ts +++ b/apps/open-swe/src/utils/logger.ts @@ -74,7 +74,12 @@ function logWithOptionalIds(styledPrefix: string, message: string, data?: any) { export function createLogger(level: LogLevel, prefix: string) { const hash = simpleHash(prefix); const color = COLORS[hash % COLORS.length]; - const styledPrefix = `${BOLD}${color}[${prefix}]${RESET}`; // Apply bold and color + + // Use plain prefix in production, styled prefix otherwise + const styledPrefix = + process.env.NODE_ENV === "production" + ? `[${prefix}]` + : `${BOLD}${color}[${prefix}]${RESET}`; return { debug: (message: string, data?: any) => {