This commit is contained in:
Alex38Lyon committed 2026-10-14 23:21:59 +02:00
1 parent 596596cf98
commit 3e7ab1a7e2
3 files changed
+77 -2

No files matched your search

+5 -2
View File
@@ -98,10 +98,13 @@ INTERACTIF = sys.stdout.isatty() and sys.stderr.isatty() and os.environ.get("TER
#################################################################################################
class ConsoleFormatter(logging.Formatter):
def format(self, record):
color = COLOR_CODES.get(record.levelno, "")
message = super().format(record)
return f"{color}{message}{RESET}" if INTERACTIF else strip_ansi_codes(message)
if INTERACTIF:
color = COLOR_CODES.get(record.levelno, "")
return f"{color}{message}{RESET}"
return strip_ansi_codes(message)
#################################################################################################