When making command line interfaces, it's often useful to colorize the output to emphasize salient pieces of information or otherwise enhance the user experience. Unfortunately it's quite cumbersome to add colorized outputs to Python log messages.
The ColorFormatter is a logging formatter that parses your log messages and adds color codes to the log messages.
The ColorStripper formatter is the inverse of the ColorFormatter. It strips the color information from your messages so that you can safely log to a file.
I'm on pypi!
$ pip install log_color
- Simple to use
- No external dependencies
- Compatibility with Python2.6, Python 2.7, Python 3.x, PyPy
This project uses a Makefile for various tasks. Some of the available tasks are listed below.
make clean- Clean build artifacts out of your project
make test- Run Unit Tests (using nose & tox)
make sdist- Build a Python source distribution
make wheel- Build a Python wheel
make docs- Build the Sphinx documentation
make publish- publish any artifacts in dist/* using twine
make pep8- Get a pep8 compliance report about your code
make- Equivalent to
make test pep8 docs sdist rpm
LogColor honors the
NO_COLOR environment variable.