Skip to content

[Misc] Colorize logs#29017

Merged
mgoin merged 5 commits intovllm-project:mainfrom
njhill:log-colours
Nov 20, 2025
Merged

[Misc] Colorize logs#29017
mgoin merged 5 commits intovllm-project:mainfrom
njhill:log-colours

Conversation

@njhill
Copy link
Copy Markdown
Member

@njhill njhill commented Nov 19, 2025

Only takes effect when output to a terminal device.

Before
Screenshot From 2025-11-19 08-31-31

After
image

Signed-off-by: Nick Hill <nhill@redhat.com>
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces colored logging, which is a great enhancement for readability. The implementation is mostly solid, adding a VLLM_LOGGING_COLOR environment variable to control the behavior (auto, always, never). A new ColoredFormatter is introduced to handle the coloring logic. I've found a minor issue in the ColoredFormatter where the coloring of file path and line number is not applied as intended, and I've provided a suggestion to fix it. Overall, a good addition.

Signed-off-by: Nick Hill <nhill@redhat.com>
Signed-off-by: Nick Hill <nhill@redhat.com>
@njhill njhill added the ready ONLY add when PR is ready to merge/full CI is needed label Nov 19, 2025


def test_default_vllm_root_logger_configuration():
def test_default_vllm_root_logger_configuration(monkeypatch):
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most of the changes in this file are just changing from using mock @patch of global vars to monkeypatch.setenv()

Copy link
Copy Markdown
Member

@mgoin mgoin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the colors

@mgoin mgoin merged commit 9ccef8e into vllm-project:main Nov 20, 2025
44 checks passed
@njhill njhill deleted the log-colours branch November 20, 2025 00:41
RunkaiTao pushed a commit to RunkaiTao/vllm that referenced this pull request Nov 24, 2025
Signed-off-by: Nick Hill <nhill@redhat.com>
Signed-off-by: Runkai Tao <rt572@physics.rutgers.edu>
devpatelio pushed a commit to SumanthRH/vllm that referenced this pull request Nov 29, 2025
Signed-off-by: Nick Hill <nhill@redhat.com>
kitaekatt pushed a commit to kitaekatt/vllm that referenced this pull request Dec 1, 2025
Signed-off-by: Nick Hill <nhill@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready ONLY add when PR is ready to merge/full CI is needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants