Spaces:
Running
Running
| """ | |
| Centralized Logging Configuration | |
| """ | |
| import logging | |
| import sys | |
| from datetime import datetime | |
| def setup_logging(): | |
| logging.basicConfig( | |
| level=logging.INFO, | |
| format="%(asctime)s | %(levelname)-8s | %(name)s | %(message)s", | |
| handlers=[ | |
| logging.StreamHandler(sys.stdout), | |
| logging.FileHandler("neuraprompt.log", encoding="utf-8") | |
| ] | |
| ) | |
| # Reduce noise from libraries | |
| logging.getLogger("httpx").setLevel(logging.WARNING) | |
| logging.getLogger("pymongo").setLevel(logging.WARNING) | |
| return logging.getLogger("neuraprompt") |