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

Add color to the logging output #578

Open
mkilgore opened this issue Nov 26, 2024 · 0 comments
Open

Add color to the logging output #578

mkilgore opened this issue Nov 26, 2024 · 0 comments
Labels
enhancement New feature or request logging

Comments

@mkilgore
Copy link
Contributor

The logging support added by #556 does not use colors, when viewed from an interactive output we should color the output to make it easier to read. Some things to consider:

  • On Linux and Mac OS, we should use isatty() to determine whether to include colors or not (that way colors are not used if the result is being piped to a file or similar).
    • We should have an override environment variable to allow bypassing the isatty() check. NO_COLOR and FORCE_COLOR are the typical "standard" variables for this.
  • Windows requires special handling:
    • For regular Console coloring we have to use the wincon.h API.
    • For Windows 10+, Terminal, and MinTTY we can use regular escape sequences like on Linux and Mac OS.
      • We'll need to check if isatty() still works on Windows. isValidCygwinPipe can probably complement it.
@mkilgore mkilgore added enhancement New feature or request logging labels Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request logging
Projects
None yet
Development

No branches or pull requests

1 participant