From 5c02d46f1ddfe8cfa16f6f9d811652333590cb5d Mon Sep 17 00:00:00 2001 From: Brahim Hadriche Date: Fri, 31 Jan 2025 18:17:20 -0500 Subject: [PATCH] [skip ci] enable colored logs in debug mode --- tools/bs-plugins/logger-plugin.ts | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/tools/bs-plugins/logger-plugin.ts b/tools/bs-plugins/logger-plugin.ts index 54cd7943..a194b3f7 100644 --- a/tools/bs-plugins/logger-plugin.ts +++ b/tools/bs-plugins/logger-plugin.ts @@ -162,21 +162,18 @@ export class LoggerPlugin implements CompilerPlugin { const func = logFunctions[level as 'LogError' | 'LogWarn' | 'LogInfo' | 'LogDebug']; - // https://github.com/microsoft/vscode/issues/571 - const USE_COLOR = false; - - const RED = '[31m'; - const YELLOW = '[33m'; - const GREEN = '[32m'; - const BOLD = '[1m'; - const BOLD_RED = '[1;31m'; - const BOLD_YELLOW = '[1;33m'; - const BOLD_GREEN = '[1;32m'; - const CLEAR = '[0m'; - let logLine = ''; - if (isDebug && USE_COLOR) { + if (isDebug) { + const RED = '[31m'; + const YELLOW = '[33m'; + const GREEN = '[32m'; + const BOLD = '[1m'; + const BOLD_RED = '[1;31m'; + const BOLD_YELLOW = '[1;33m'; + const BOLD_GREEN = '[1;32m'; + const CLEAR = '[0m'; + switch (func.stringLevel) { case 'ERROR': logLine = `Chr(27) + "${BOLD_RED}" + "[${func.stringLevel}]" + Chr(27) + "${RED}" + ${msg} + Chr(27) + "${CLEAR}"`;