0

I am using logging module in Python and I already use a custom formatter that just changes the format of the message depending on level.

As I use a lot of message in the tool I am writing I wonder if there is a way to write a log message with a colour

I don't want it to be definitive (i.e. add colours in the formatter class) I would like to write a log message

logging.info('i am doing this, wait...')

in red (or any other colour)

regards

bruvio
  • 533
  • 6
  • 20

1 Answers1

0

Here is a description of how you can do this. Available via the logutils package from PyPI (I'm the maintainer).

Vinay Sajip
  • 90,050
  • 14
  • 168
  • 180