1

I am using Python's built-in logging library to log information, but I cannot find a way to set these colors so that I can distinguish them from actual error colors.

enter image description here

I have tried to change Run > Edit Configurations... > Configuration > Emulate terminal settings.

I have tried to use Grep Console Plugin.

I have tried creating another script for log file, as suggest here But this gives me following result:

enter image description here

Here is how I set the configuration of logger.

import logging

logging.basicConfig(level=logging.DEBUG, format='%(levelname)s:%(message)s')

logging.debug("this is debug")
logging.info("this is info")
logging.warning("this is warning")
logging.error("this is error")
logging.critical("this is critical")
# this needs to be RED.
print("10 / 0 =", 10 / 0)

I would like to use some (reasonable) color scheme, not RED colors for info logs, similar to shown here:

enter image description here

I am using the following following version of PyCharm:

PyCharm 2020.3.1 (Professional Edition)
Build #PY-203.6682.86, built on August 12, 2021

Any help is greatly appreciated.

Ibrahim Berber
  • 842
  • 2
  • 16

0 Answers0