Spaces:
Sleeping
Sleeping
Download src/Text_to_SQL/logger.py from DPamneja/Text_to_SQL_Application: direct link, hf CLI and curl.
- Browser
- Download file 460 Bytes
-
https://huggingface.co/spaces/DPamneja/Text_to_SQL_Application/resolve/main/src/Text_to_SQL/logger.py
- Command line
-
hf download hf://spaces/DPamneja/Text_to_SQL_Application/src/Text_to_SQL/logger.py
-
curl -L -o logger.py https://huggingface.co/spaces/DPamneja/Text_to_SQL_Application/resolve/main/src/Text_to_SQL/logger.py
460 Bytes
| import logging | |
| import os | |
| from datetime import datetime | |
| # Create the paths and file | |
| 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_FILE_PATH = os.path.join(log_path,LOG_FILE) | |
| # Implement logging | |
| logging.basicConfig( | |
| level = logging.INFO, | |
| filename = LOG_FILE_PATH, | |
| format = "[%(asctime)s] %(lineno)d %(name)s - %(levelname)s - %(message)s" | |
| ) | |