From 63c56c8dd97a1b22658b14f3722ac4b9b3e85e22 Mon Sep 17 00:00:00 2001 From: Danny Avila Date: Thu, 29 May 2025 15:18:52 -0400 Subject: [PATCH] refactor(data-schemas): simplify environment variable checks in winston configuration --- packages/data-schemas/src/config/winston.ts | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/packages/data-schemas/src/config/winston.ts b/packages/data-schemas/src/config/winston.ts index 09e8dafc8c..598d967394 100644 --- a/packages/data-schemas/src/config/winston.ts +++ b/packages/data-schemas/src/config/winston.ts @@ -9,17 +9,11 @@ const logDir = path.join(__dirname, '..', 'logs'); // Type-safe environment variables const { NODE_ENV, DEBUG_LOGGING, CONSOLE_JSON, DEBUG_CONSOLE } = process.env; -const useConsoleJson = - (typeof CONSOLE_JSON === 'string' && CONSOLE_JSON.toLowerCase() === 'true') || - CONSOLE_JSON === true; +const useConsoleJson = typeof CONSOLE_JSON === 'string' && CONSOLE_JSON.toLowerCase() === 'true'; -const useDebugConsole = - (typeof DEBUG_CONSOLE === 'string' && DEBUG_CONSOLE.toLowerCase() === 'true') || - DEBUG_CONSOLE === true; +const useDebugConsole = typeof DEBUG_CONSOLE === 'string' && DEBUG_CONSOLE.toLowerCase() === 'true'; -const useDebugLogging = - (typeof DEBUG_LOGGING === 'string' && DEBUG_LOGGING.toLowerCase() === 'true') || - DEBUG_LOGGING === true; +const useDebugLogging = typeof DEBUG_LOGGING === 'string' && DEBUG_LOGGING.toLowerCase() === 'true'; // Define custom log levels const levels: winston.config.AbstractConfigSetLevels = {