Download src/logger/logger.py from Umesh143/Chatmate: direct link, hf CLI and curl.
- Browser
- Download file 459 Bytes
-
https://huggingface.co/spaces/Umesh143/Chatmate/resolve/main/src/logger/logger.py
- Command line
-
hf download hf://spaces/Umesh143/Chatmate/src/logger/logger.py
-
curl -L -o logger.py https://huggingface.co/spaces/Umesh143/Chatmate/resolve/main/src/logger/logger.py
459 Bytes
| import logging | |
| import os | |
| from datetime import datetime | |
| LOG_FILE=f"{datetime.now().strftime('%m_%d_%Y_%H_%M_%S')}.log" | |
| log_path=os.path.join(os.getcwd(),"logs") | |
| os.makedirs(log_path,exist_ok=True) | |
| LOG_FILEPATH=os.path.join(log_path,LOG_FILE) | |
| logging.basicConfig(level=logging.INFO, | |
| filename=LOG_FILEPATH, | |
| format="[%(asctime)s] %(lineno)d %(name)s - %(levelname)s - %(message)s" | |
| ) | |