Skip to content
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

Support FORCE_COLOR #1306

Merged
merged 1 commit into from
Feb 20, 2025
Merged

Support FORCE_COLOR #1306

merged 1 commit into from
Feb 20, 2025

Conversation

nhurden
Copy link
Contributor

@nhurden nhurden commented Feb 20, 2025

https://force-color.org/

Fixes #1305

Also updates NO_COLOR to handle empty strings correctly per the spec:

Command-line software which adds ANSI color to its output by default should check for a NO_COLOR environment variable that, when present and not an empty string (regardless of its value), prevents the addition of ANSI color.

@Delgan Delgan merged commit bc2ec9a into Delgan:master Feb 20, 2025
20 checks passed
@Delgan
Copy link
Owner

Delgan commented Feb 20, 2025

Thanks for the new implementation of FORCE_COLOR and the fix of the inaccurate implementation of NO_COLOR. 👍

There appear to be many competing standards, see also: CLICOLOR.
Initially, I had reservations about which of these variables should be honored. In particular because I've read various OSS maintainers complaining about the situation and refusing to implement some of them.

However, I just discovered that the Python CLI itself respects NO_COLOR and FORCE_COLOR, which makes it the de facto standard to follow for Loguru as well.

@nhurden nhurden deleted the nh/force-color branch February 21, 2025 08:03
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.

Support for FORCE_COLOR
2 participants