Spaces:
Sleeping
Sleeping
| import logging | |
| import os | |
| from datetime import datetime | |
| LOG_FILE = f"{datetime.now().strftime('%Y_%m_%d_%H_%M_%S')}.log" | |
| # Create the 'logs' directory if it doesn't exist | |
| logs_dir = os.path.join(os.getcwd(), 'logs') | |
| os.makedirs(logs_dir, exist_ok=True) | |
| # Create the full path to the log file | |
| LOG_FILE_PATH = os.path.join(logs_dir, LOG_FILE) | |
| logging.basicConfig( | |
| filename=LOG_FILE_PATH, | |
| format='[ %(asctime)s ] %(lineno)d %(name)s - %(levelname)s - %(message)s', | |
| level=logging.INFO | |
| ) |