xolox / python-coloredlogs

Colored terminal output for Python's logging module
https://coloredlogs.readthedocs.io
MIT License
545 stars 44 forks source link

levelname format not showing #77

Closed Puyodead1 closed 4 years ago

Puyodead1 commented 4 years ago

Hello, I'm trying to format the output and put the levelname in square brackets, everything else formats correctly except the levelname which doesn't show. image Here is the code I'm using:

verboselogs.install()
logger = logging.getLogger("PyBot")
coloredlogs.install(level="INFO", logger=logger, fmt="[%(levelname)s] %(asctime)s: %(message)s", datefmt="[%m-%d-%Y %I:%M:%S]")
Puyodead1 commented 4 years ago

Found out that the level names are black so they're hidden in Command Prompt

CodingKoopa commented 3 weeks ago

Quick fix, for anyone else wondering:

coloredlogs.DEFAULT_FIELD_STYLES["levelname"]["color"] = "white"