diff --git a/server.py b/server.py index 3c4da4ecd..17dece38e 100644 --- a/server.py +++ b/server.py @@ -2,7 +2,9 @@ import asyncio import logging import os +from rich.console import Console from rich.logging import RichHandler +from rich.theme import Theme import sys import warnings import subprocess @@ -36,16 +38,17 @@ def setup_logger(level=logging.DEBUG): - format = "%(asctime)s - %(levelname)-5s (%(filename)s:%(lineno)s %(funcName)s) %(message)s" + format = "%(message)s" datefmt = "%Y-%m-%d %H:%M:%S" if no_color(): logging.basicConfig(level=level, format=format, datefmt=datefmt) else: + console = Console(theme=Theme({"logging.level.warning": "yellow"})) logging.basicConfig( level=level, format=format, datefmt=datefmt, - handlers=[RichHandler(rich_tracebacks=True, markup=True, show_time=False)] + handlers=[RichHandler(rich_tracebacks=True, markup=True, console=console)] ) for logger_name in logging.root.manager.loggerDict.keys():