Spaces:
Runtime error
Runtime error
File size: 477 Bytes
29793a4 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
import logging
import os
from datetime import datetime as dt
LOG_FILE = f"{dt.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"
)
if __name__ == '__main__':
logging.info("Log testing executed!!!") |