Change the way that store the log files. Now, when run the program, You need make the directory by yourself.

This commit is contained in:
pythagodzilla 2025-06-20 08:58:22 +08:00
parent 47c88140c3
commit 7807a9ee53

View File

@ -1,6 +1,7 @@
import os import os
import requests import requests
import time import time
import datetime
import selenium.common.exceptions import selenium.common.exceptions
import logging import logging
from dotenv import load_dotenv from dotenv import load_dotenv
@ -11,7 +12,7 @@ logging.basicConfig(
level=logging.INFO, level=logging.INFO,
format="%(levelno)s - %(levelname)s - %(asctime)s - %(name)s - %(message)s", format="%(levelno)s - %(levelname)s - %(asctime)s - %(name)s - %(message)s",
datefmt="%Y-%m-%d %H:%M:%S", datefmt="%Y-%m-%d %H:%M:%S",
filename="log.log", filename=f"logs/{datetime.date.today()}.log",
filemode="a" filemode="a"
) )