feat(core): 新增日志管理功能

- 在配置文件中添加日志保存和保留天数设置项
- 实现日志保存功能,每次运行后保存日志到指定目录
- 添加日志分析功能,掉落信息并保存为 JSON 文件
- 在设置界面新增日志管理相关配置选项

todo: 日志清理可能有问题、多账号日志可能会保存为上一个账号的日志(加了time.sleep还没测)
This commit is contained in:
2025-02-18 17:29:13 +08:00
parent 2768faed53
commit 3a9c670172
4 changed files with 225 additions and 0 deletions

View File

@@ -582,6 +582,12 @@ class GlobalConfig(QConfig):
update_UpdateType = OptionsConfigItem(
"Update", "UpdateType", "main", OptionsValidator(["main", "dev"])
)
# 日志管理
function_IfEnableLog = ConfigItem("Function", "IfEnableLog", False, BoolValidator())
function_LogRetentionDays = OptionsConfigItem(
"Function", "LogRetentionDays", "7 天",
OptionsValidator(["7 天", "15 天", "30 天", "60 天", "永不清理"])
)
class QueueConfig(QConfig):