Spaces:
Sleeping
Sleeping
Download api/logger.py from Clare-AI/ClareVoiceV1: direct link, hf CLI and curl.
- Browser
- Download file 514 Bytes
-
https://huggingface.co/spaces/Clare-AI/ClareVoiceV1/resolve/main/api/logger.py
- Command line
-
hf download hf://spaces/Clare-AI/ClareVoiceV1/api/logger.py
-
curl -L -o logger.py https://huggingface.co/spaces/Clare-AI/ClareVoiceV1/resolve/main/api/logger.py
514 Bytes
| # 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) | |