-
-
Notifications
You must be signed in to change notification settings - Fork 646
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Log color is broken sometimes #11020
Comments
I've noticed this. I think it's when pantsd is used. In fact, I don't think colors for the WARN part ever work for me with pantsd. |
The way that we should likely solve this will be shaken up quite a bit by #11536, but it is still an issue. Post #11536, we should likely convert the |
What is |
Yea. So could convert into an actual ternary... would probably want to do EDIT: Updated the description with this info. |
As described in #11020, stderr logging was not colorized with `pantsd`. This was due to three-ish issues: * Whether to use color was computed via bootstrap options in the daemon, and set in logging initialization. This was too early for per-connection options to take effect. * The `console` crate was using environment variables to detect whether to enable color rendering, and this detection needed to be turned off. * The `colored` crate was also using environment variables which needed to be overridden. Additionally, simplify atomicity of the logger by using an inner mostly-immutable struct inside of an `ArcSwap`. Fixes #11020. [ci skip-build-wheels]
The decision of whether to use color is made very early in the startup process, while the default value for the
--[no-]colors
flag is being computed:pants/src/python/pants/option/global_options.py
Lines 533 to 541 in af5fad7
Instead, the
--[no-]colors
flag should become a ternary (either explicitly e.g. "yes, no, auto" or implicitly e.g. "true, false, None"), and in case of "auto", we should lazily detect the TTY per destination:pants/src/rust/engine/logging/src/logger.rs
Lines 198 to 199 in af5fad7
The text was updated successfully, but these errors were encountered: