mirror of
https://github.com/hanxi/xiaomusic.git
synced 2026-04-23 22:10:11 +08:00
fix: 修复日志文件删除失败的问题
This commit is contained in:
@@ -171,7 +171,10 @@ class XiaoMusic:
|
||||
if log_path and not os.path.exists(log_path):
|
||||
os.makedirs(log_path)
|
||||
if os.path.exists(log_file):
|
||||
os.remove(log_file)
|
||||
try:
|
||||
os.remove(log_file)
|
||||
except Exception as e:
|
||||
self.log.warning(f"无法删除旧日志文件: {log_file} {e}")
|
||||
handler = RotatingFileHandler(
|
||||
self.config.log_file,
|
||||
maxBytes=10 * 1024 * 1024,
|
||||
|
||||
Reference in New Issue
Block a user