From cd3b141e3cf4e8a70e2496b0eee63877c7670c12 Mon Sep 17 00:00:00 2001 From: Danny Avila Date: Fri, 12 Dec 2025 20:09:31 -0500 Subject: [PATCH] refactor: Update Frontend logger function to enhance logging conditions - Modified the logger function to check for logger enablement and development environment more robustly. - Adjusted the condition to ensure logging occurs only when the logger is enabled or when the environment variable for logger is not set in development mode. --- client/src/utils/logger.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/utils/logger.ts b/client/src/utils/logger.ts index 6bc1d21db6..b025f4926c 100644 --- a/client/src/utils/logger.ts +++ b/client/src/utils/logger.ts @@ -9,7 +9,7 @@ const createLogFunction = ( type?: 'log' | 'warn' | 'error' | 'info' | 'debug' | 'dir', ): LogFunction => { return (...args: unknown[]) => { - if (isDevelopment || isLoggerEnabled) { + if (isLoggerEnabled || (import.meta.env.VITE_ENABLE_LOGGER == null && isDevelopment)) { const tag = typeof args[0] === 'string' ? args[0] : ''; if (shouldLog(tag)) { if (tag && typeof args[1] === 'string' && type === 'error') {