Spaces:
Build error
Build error
Download src/log.py from Sukanth07/emotional-intelligence-bot: direct link, hf CLI and curl.
- Browser
- Download file 505 Bytes
-
https://huggingface.co/spaces/Sukanth07/emotional-intelligence-bot/resolve/main/src/log.py
- Command line
-
hf download hf://spaces/Sukanth07/emotional-intelligence-bot/src/log.py
-
curl -L -o log.py https://huggingface.co/spaces/Sukanth07/emotional-intelligence-bot/resolve/main/src/log.py
505 Bytes
| import os | |
| import logging | |
| from src.config import AppConfig | |
| LOGS_DIR = os.path.join(AppConfig.BASE_DIR, "logs") | |
| os.makedirs(LOGS_DIR, exist_ok=True) | |
| # Configure logging | |
| logger = logging.getLogger("EmotionalIntelligenceBot") | |
| logger.setLevel(logging.INFO) | |
| log_file_path = os.path.join(LOGS_DIR, "application.log") | |
| handler = logging.FileHandler(log_file_path) | |
| formatter = logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s") | |
| handler.setFormatter(formatter) | |
| logger.addHandler(handler) | |