awesome-fastapi-projects/populate/logger.py

13 lines
242 B
Python
Raw Normal View History

2021-11-17 09:10:33 +00:00
import logging
from rich.logging import RichHandler
logging.basicConfig(
level="NOTSET",
format="%(timestamp)s - %(message)s",
datefmt="[%X]",
handlers=[RichHandler(rich_tracebacks=True)],
)
log = logging.getLogger("rich")