SCons: Fix missing context for print_info/warning/error when colors are off

This commit is contained in:
Rémi Verschelde 2025-01-09 00:34:14 +01:00
parent 6f3cc27423
commit ffcd9eb630

View file

@ -111,7 +111,7 @@ def print_info(*values: object) -> None:
if _stdout_override:
print(f"{Ansi.GRAY}{Ansi.BOLD}INFO:{Ansi.REGULAR}", *values, Ansi.RESET)
else:
print(*values)
print("INFO:", *values)
def print_warning(*values: object) -> None:
@ -119,7 +119,7 @@ def print_warning(*values: object) -> None:
if _stderr_override:
print(f"{Ansi.YELLOW}{Ansi.BOLD}WARNING:{Ansi.REGULAR}", *values, Ansi.RESET, file=sys.stderr)
else:
print(*values, file=sys.stderr)
print("WARNING:", *values, file=sys.stderr)
def print_error(*values: object) -> None:
@ -127,4 +127,4 @@ def print_error(*values: object) -> None:
if _stderr_override:
print(f"{Ansi.RED}{Ansi.BOLD}ERROR:{Ansi.REGULAR}", *values, Ansi.RESET, file=sys.stderr)
else:
print(*values, file=sys.stderr)
print("ERROR:", *values, file=sys.stderr)