How to customize the color of different messages in one log file

151 Views Asked by At

I am using loguru module in python. And I want to control that the messages output to a log file have different colors for instance, if I set the new level is "colorInfo_blue", the default color for "INFO" is white.

logger.info("white")
logger.colorInfo_blue("blue")

I want these two message have the different color just in one log file.

I have done this: enter image description here But it did not work enter image description here

I want to control the color when write the log file. How shoud I change the code.

0

There are 0 best solutions below