ClareVoiceV1 / api /logger.py
ghazariann's picture
preload embedding model, add logging
cc8fad5
# api/logger.py
"""
Central logging configuration for Clare.
Set CLARE_LOG_LEVEL=DEBUG in .env to enable verbose logging.
Levels: DEBUG, INFO, WARNING, ERROR
"""
import logging
import os
CLARE_LOG_LEVEL = os.getenv("CLARE_LOG_LEVEL", "INFO").strip().upper()
logging.basicConfig(
level=getattr(logging, CLARE_LOG_LEVEL, logging.INFO),
format="%(asctime)s [%(levelname)s] %(name)s — %(message)s",
datefmt="%H:%M:%S",
)
def get_logger(name: str) -> logging.Logger:
return logging.getLogger(name)