remove unnecessary log
This commit is contained in:
9224
logs/2025-07-28.log
9224
logs/2025-07-28.log
File diff suppressed because it is too large
Load Diff
5
main.py
5
main.py
@@ -28,14 +28,13 @@ def setup_logging():
|
|||||||
"""配置日志记录"""
|
"""配置日志记录"""
|
||||||
global LOGGER # 声明使用全局logger
|
global LOGGER # 声明使用全局logger
|
||||||
Path(LOG_DIR).mkdir(exist_ok=True)
|
Path(LOG_DIR).mkdir(exist_ok=True)
|
||||||
log_file = Path(LOG_DIR) / datetime.now().strftime(LOG_FILE_FORMAT)
|
log_file = Path("output.log")
|
||||||
|
|
||||||
logging.basicConfig(
|
logging.basicConfig(
|
||||||
level=logging.INFO,
|
level=logging.WARNING, # 只记录WARNING及以上级别
|
||||||
format="%(asctime)s - %(levelname)s - %(message)s",
|
format="%(asctime)s - %(levelname)s - %(message)s",
|
||||||
handlers=[
|
handlers=[
|
||||||
logging.FileHandler(log_file, encoding="utf-8"),
|
logging.FileHandler(log_file, encoding="utf-8"),
|
||||||
logging.StreamHandler(),
|
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
LOGGER = logging.getLogger(__name__) # 赋值给全局logger
|
LOGGER = logging.getLogger(__name__) # 赋值给全局logger
|
||||||
|
Reference in New Issue
Block a user