Colorize Flask Logging

Mon 29 May 2017

Filed under programming

Tags python development

Here's a simple drop-in colorizer for Werkzeug (and thus also Flask) logs. It won't make much sense in production, but makes development a bit more cheerful.

Screenshot

Adding gouge.colourcli to the mix, makes it even more colourful:

Screenshot using gouge.colourcli

To use it, simply put it in a utility module somewhere, import it and call colorize_wekzeug.

You will need blessings. If that's not available, the function will not do any colorizing.

The code is hosted as a gist on GitHub:


Comments



Michel Albert © Michel Albert Powered by Pelican and Twitter Bootstrap. Icons by Font Awesome and Font Awesome More