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 for 256-color output #35

Closed
anntzer opened this issue Aug 1, 2017 · 2 comments
Closed

Support for 256-color output #35

anntzer opened this issue Aug 1, 2017 · 2 comments

Comments

@anntzer
Copy link
Contributor

anntzer commented Aug 1, 2017

It would be appreciated if it was possible to use 256-color output (https://en.wikipedia.org/wiki/ANSI_escape_code#Colors), e.g. by allowing the "color" field of DEFAULT_{FIELD,LEVEL}_STYLES to be a 0-255 integer.

@mattconsto
Copy link

To add onto this, it would be useful to be able to change the background colour as well as the foreground colour. Right now it's hard to distinguish critical logs from error logs.

xolox added a commit to xolox/python-humanfriendly that referenced this issue Jan 14, 2018
Related to issue 35 on the coloredlogs issue tracker:
xolox/python-coloredlogs#35
xolox added a commit to xolox/python-humanfriendly that referenced this issue Jan 14, 2018
xolox added a commit that referenced this issue Jan 17, 2018
Related to #35.

Most of the changes required for this were actually implemented in the
humanfriendly package (see the issue above). The only changes required
in coloredlogs were:

- Bumping the version number of the humanfriendly requirement.

- Updating the ANSI to HTML conversion code to support background colors
  and 256 color mode. While doing so I made the code a bit more robust
  against malformed and unsupported ANSI escape sequences.

- Documenting how it all works. This will follow in the next commit
  which is going to be a rather big one (hence why I see some value
  in keeping it separate from the implementation changes).
@xolox xolox closed this as completed in 399af2a Jan 17, 2018
@xolox
Copy link
Owner

xolox commented Jan 17, 2018

Thanks for the feedback Antony and Matthew. Release 9.0 of coloredlogs adds support for 256 color mode and background colors. As suggested by Antony the color field (as well as the new background field) now support integer values which select colors from the 256 color mode palette.

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

No branches or pull requests

3 participants