Spaces:
Sleeping
Sleeping
File size: 460 Bytes
9d09bcd | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | 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"
)
|