4465 shaares
Disclaimer: this post was heaviliy inspired by the 2 following gists:
color_log.pyusingtermcolorrecipescolorlog.pyusingcolorama
I loved the simplicity of the first, not having to manipulate any of the logging internal API, but I prefer colorama over termcolor.
Without further ado, there is my solution …