Colourised Terminal Output for Python Logging
Here's a very simple way (and the correct) way to colourise logging output for the console:
https://gist.github.com/exhuma/8147910
The script uses blessings to deal with terminal intricacies. It's a very thin module. No external dependencies (at least at version 1.5.1) and makes colourising easy.
Next, it uses a standard "Formatter" to implement the core functionality. Don't use filters, don't put that code elsewhere! We are formatting the output. So a Formatter it is!
Written by exhuma
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Python
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#