From 92e7562a994038c904fea859d90462c7e84a3246 Mon Sep 17 00:00:00 2001 From: Tsukasa OI Date: Fri, 6 Feb 2026 03:47:09 +0900 Subject: [PATCH] [Bugfix] Suppress non-TTY color output on the process name part of the log (#29714) Signed-off-by: Tsukasa OI --- vllm/utils/system_utils.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/vllm/utils/system_utils.py b/vllm/utils/system_utils.py index 180a8d08b..840056e8b 100644 --- a/vllm/utils/system_utils.py +++ b/vllm/utils/system_utils.py @@ -179,7 +179,12 @@ def set_process_title( def _add_prefix(file: TextIO, worker_name: str, pid: int) -> None: """Add colored prefix to file output for log decoration.""" - if envs.NO_COLOR: + is_tty = hasattr(file, "isatty") and file.isatty() + if ( + envs.NO_COLOR + or envs.VLLM_LOGGING_COLOR == "0" + or (envs.VLLM_LOGGING_COLOR != "1" and not is_tty) + ): prefix = f"({worker_name} pid={pid}) " else: prefix = f"{CYAN}({worker_name} pid={pid}){RESET} "