Files
Nat20-Notes/backend/app/logging_config.py

19 lines
499 B
Python

import logging
import sys
def setup_logging():
logging.basicConfig(
level=logging.INFO,
format="%(asctime)s %(levelname)-8s %(name)s: %(message)s",
datefmt="%Y-%m-%d %H:%M:%S",
stream=sys.stdout,
)
# quiet down noisy libraries so pipeline logs are easy to spot
for noisy in ("httpx", "urllib3", "pyannote"):
logging.getLogger(noisy).setLevel(logging.WARNING)
def get_logger(name: str) -> logging.Logger:
return logging.getLogger(name)