Skip to content

Implement --log-colors with always/never/auto - #15792

Merged
ericcurtin merged 1 commit into
masterfrom
auto-color
Sep 5, 2025
Merged

ericcurtin merged 1 commit into
masterfrom
auto-color

Conversation

@ericcurtin

Copy link
Copy Markdown
Collaborator

With auto by default

@ericcurtin

Copy link
Copy Markdown
Collaborator Author

@CISC @ngxson PTAL

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements a --log-colors option with three modes: always, never, and auto, with auto as the default. The auto mode intelligently detects whether colors should be enabled based on terminal capabilities and environment variables.

Key Changes

  • Adds auto-detection logic for color support based on terminal type and environment variables (NO_COLOR, TERM)
  • Updates the --log-colors argument to accept three values instead of being a boolean flag
  • Sets auto-detection as the default behavior for the main log instance

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
common/log.h Adds declaration for new common_log_set_colors_auto function
common/log.cpp Implements auto-detection logic and initializes main log with auto-detection
common/arg.cpp Updates --log-colors argument parser to handle three modes with validation

Comment thread common/log.cpp Resolved
@ericcurtin
ericcurtin force-pushed the auto-color branch 6 times, most recently from 50c698c to 09348d2 Compare September 4, 2025 21:18
@ericcurtin

Copy link
Copy Markdown
Collaborator Author

@JohannesGaessler @slaren PTAL

Comment thread common/arg.cpp Resolved
Comment thread common/arg.cpp Resolved
Comment thread common/log.cpp Resolved
Comment thread common/arg.cpp Resolved
@ericcurtin
ericcurtin force-pushed the auto-color branch 2 times, most recently from b58a0b3 to 19fcb5c Compare September 5, 2025 13:42
@ericcurtin

Copy link
Copy Markdown
Collaborator Author

All comments resolved @JohannesGaessler ready for re-review

Comment thread common/arg.cpp Resolved
Comment thread common/arg.cpp Resolved
Comment thread common/log.cpp Resolved
@ericcurtin
ericcurtin force-pushed the auto-color branch 2 times, most recently from 1fa4a19 to ef5855e Compare September 5, 2025 14:12
@ericcurtin

Copy link
Copy Markdown
Collaborator Author

All comments resolved again @JohannesGaessler ready for re-review

With auto by default

Signed-off-by: Eric Curtin <ericcurtin17@gmail.com>
@ericcurtin
ericcurtin merged commit 408ff52 into master Sep 5, 2025
@ericcurtin
ericcurtin deleted the auto-color branch September 5, 2025 18:44
gabe-l-hart added a commit to gabe-l-hart/llama.cpp that referenced this pull request Sep 5, 2025
…upport

* origin/master:
Thinking model disabled assistant prefill (ggml-org#15404)
Implement --log-colors with always/never/auto (ggml-org#15792)
CUDA: fastdiv, launch bounds for mmvq + q8_1 quant (ggml-org#15802)
tests : add --list-ops and --show-coverage options (ggml-org#15745)
gguf: gguf_writer refactor (ggml-org#15691)
kv-cache : fix SWA checks + disable cacheless iSWA (ggml-org#15811)
model-conversion : add --embeddings flag to modelcard.template [no ci] (ggml-org#15801)
chat : fixed crash when Hermes 2 <tool_call> had a newline before it (ggml-org#15639)
chat : nemotron thinking & toolcalling support (ggml-org#15676)
scripts : add Jinja tester PySide6 simple app (ggml-org#15756)
llama : add support for EmbeddingGemma 300m (ggml-org#15798)
walidbr pushed a commit to walidbr/llama.cpp that referenced this pull request Sep 7, 2025
With auto by default

Signed-off-by: Eric Curtin <ericcurtin17@gmail.com>
Nexesenex added a commit to Nexesenex/croco.cpp that referenced this pull request Oct 26, 2025
blime4 referenced this pull request in blime4/llama.cpp Feb 5, 2026
With auto by default

Signed-off-by: Eric Curtin <ericcurtin17@gmail.com>
Seunghhon pushed a commit to Seunghhon/llama.cpp that referenced this pull request Apr 26, 2026
With auto by default

Signed-off-by: Eric Curtin <ericcurtin17@gmail.com>
my-other-github-account pushed a commit to my-other-github-account/llama.cpp that referenced this pull request May 15, 2026
With auto by default

Signed-off-by: Eric Curtin <ericcurtin17@gmail.com>
fukuro-kun pushed a commit to fukuro-kun/fukuro-llama-cpp-turboquant that referenced this pull request Jul 5, 2026
With auto by default

Signed-off-by: Eric Curtin <ericcurtin17@gmail.com>
MrLordCat referenced this pull request in MrLordCat/llama.cpp-rdna-lab Jul 16, 2026
With auto by default

Signed-off-by: Eric Curtin <ericcurtin17@gmail.com>
AMD-melliott pushed a commit to AMD-melliott/llama.cpp that referenced this pull request Aug 4, 2026
With auto by default

Signed-off-by: Eric Curtin <ericcurtin17@gmail.com>
zommiommy pushed a commit to zommiommy/llama.cpp that referenced this pull request Aug 18, 2026
With auto by default

Signed-off-by: Eric Curtin <ericcurtin17@gmail.com>
frostyautumnleaf pushed a commit to frostyautumnleaf/llama.cpp that referenced this pull request Oct 5, 2026
With auto by default

Signed-off-by: Eric Curtin <ericcurtin17@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants