first
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
"""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)
|
||||
Reference in New Issue
Block a user