colorama is nice little package to add color to console messages. It make the logs look better where you can spot important messages quickly.
I usually add the argument to disable coloring if i need to.
from colorama import Fore,Style
import config
if not config.batch:
class DummyFore:
BLACK=RED=GREEN=YELLOW=BLUE=MAGENTA=CYAN=WHITE=RESET=''
class DummyStyle:
RESET_ALL = ""
saved_Fore, Fore = Fore, DummyFore
saved_Style, Style = Style, DummyStyle
Then use my package instead using of using colorama directly. It’s also good idea to use colors combined with python built-in logging module.
from common.colors import Fore,Style
logging.info(f"{Fore.GREEN}PASS{Style.RESET_ALL}")