17 lines
397 B
Python
17 lines
397 B
Python
"""Centrální logging. Nikdy nelogujeme secrets (API klíče, hlavičky s creds)."""
|
|
import logging
|
|
import os
|
|
|
|
_LEVEL = os.getenv("LOG_LEVEL", "INFO").upper()
|
|
|
|
|
|
def configure_logging() -> None:
|
|
logging.basicConfig(
|
|
level=_LEVEL,
|
|
format="%(asctime)s %(levelname)s [%(name)s] %(message)s",
|
|
)
|
|
|
|
|
|
def get_logger(name: str) -> logging.Logger:
|
|
return logging.getLogger(name)
|