[open-swe] feat: disable ANSI colors in logger for production environment (#374)

* Apply patch

* Apply patch

---------

Co-authored-by: open-swe-dev[bot] <open-swe-dev@users.noreply.github.com>
Co-authored-by: Brace Sproul <braceasproul@gmail.com>
This commit is contained in:
open-swe[bot] 2025-07-09 20:14:07 +00:00 • committed by GitHub
parent 4fb0f90f4e
commit a03805c704
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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) => {