Skip to content

Respect explicit --log-color and auto-detect from stdout - #9907

Open
ackintosh wants to merge 2 commits into
sigp:unstablefrom
ackintosh:issue-8122
Open

Respect explicit --log-color and auto-detect from stdout#9907
ackintosh wants to merge 2 commits into
sigp:unstablefrom
ackintosh:issue-8122

Conversation

@ackintosh

@ackintosh ackintosh commented Aug 23, 2026

Copy link
Copy Markdown
Member

Issue Addressed

Closes #8122

--log-color was ignored whenever stdin was not a terminal, so users running Lighthouse in Docker could not enable colored logs at all, even with --log-color true.

Proposed Changes

This PR makes --log-color first-class:

  • If the user passes --log-color[=<bool>], always honor it
  • Otherwise, fall back to auto-detection

Additional Info

The auto-detection now inspects stdout rather than stdin. log_color only feeds the stdout LoggingLayer — file output has its own --logfile-color —, so what matters is whether the sink interprets ANSI escapes, not whether the session is interactive.

`--log-color` was ignored whenever stdin was not a terminal, so users
running Lighthouse in Docker could not enable colored logs at all,
even with `--log-color true`.
@ackintosh ackintosh added ready-for-review The code is ready for review UX-and-logs labels Aug 23, 2026
@mergify

mergify Bot commented Aug 23, 2026

Copy link
Copy Markdown

Some required checks have failed. Could you please take a look @ackintosh? 🙏

@mergify mergify Bot added waiting-on-author The reviewer has suggested changes and awaits thier implementation. and removed ready-for-review The code is ready for review labels Aug 23, 2026
@mergify mergify Bot added ready-for-review The code is ready for review and removed waiting-on-author The reviewer has suggested changes and awaits thier implementation. labels Aug 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-review The code is ready for review UX-and-logs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant