Skip to content

导出日志时附带最近日志#4051

Merged
Glavo merged 5 commits intoHMCL-dev:mainfrom
zkitefly:output-log
Aug 10, 2025
Merged

导出日志时附带最近日志#4051
Glavo merged 5 commits intoHMCL-dev:mainfrom
zkitefly:output-log

Conversation

@zkitefly
Copy link
Copy Markdown
Member

Close #4023

@zkitefly zkitefly requested review from Glavo and burningtnt June 30, 2025 16:18
Copy link
Copy Markdown
Contributor

@3gf8jv4dv 3gf8jv4dv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

几个意见:

  1. 一般不需要太多日志吧。效仿 PCL,只导出最近五个日志文件应该够了。

  2. 三个按钮并排,对其他语言来说太长了。除简繁外其他语言,在启动器默认窗口大小下,「设置 → 通用」界面均会出现不同程度的 UI 溢出,会出现横向滚动条。如果能将两个类似功能的按钮整合成一个可行否?例如点击此按钮后出现对话框,让用户选择导出当前/最近五个日志文件。

@zkitefly
Copy link
Copy Markdown
Member Author

几个意见:

  1. 一般不需要太多日志吧。效仿 PCL,只导出最近五个日志文件应该够了。
  2. 三个按钮并排,对其他语言来说太长了。除简繁外其他语言,在启动器默认窗口大小下,「设置 → 通用」界面均会出现不同程度的 UI 溢出,会出现横向滚动条。如果能将两个类似功能的按钮整合成一个可行否?例如点击此按钮后出现对话框,让用户选择导出当前/最近五个日志文件。

那就将原来的导出当前日志的按钮替换成打包日志

打包日志目录的前五个日志

@zkitefly
Copy link
Copy Markdown
Member Author

image

image

Copy link
Copy Markdown
Contributor

@3gf8jv4dv 3gf8jv4dv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

标题记得改下。其他没啥意见。

@zkitefly zkitefly changed the title 添加 导出所有启动器日志 按钮 添加 导出最近的启动器日志 按钮 Jul 1, 2025
@Glavo Glavo changed the title 添加 导出最近的启动器日志 按钮 导出日志时附带最近日志 Aug 6, 2025
@Glavo Glavo requested a review from Copilot August 7, 2025 14:50

This comment was marked as outdated.

@Glavo Glavo requested a review from Copilot August 10, 2025 13:50
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements functionality to export recent log files along with the current log when exporting logs, addressing the requirement to include historical context in log exports.

  • Refactors log file discovery and management into a dedicated LogFile class with proper comparison capabilities
  • Adds a new findRecentLogFiles(n) method to retrieve the most recent log files
  • Updates the log export functionality to create a ZIP archive containing recent logs plus the current log

Reviewed Changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 4 comments.

File Description
HMCLCore/src/main/java/org/jackhuang/hmcl/util/logging/Logger.java Adds LogFile class for parsing/comparing log files and findRecentLogFiles() method, refactors existing log cleanup logic
HMCL/src/main/java/org/jackhuang/hmcl/ui/main/SettingsPage.java Updates log export to create ZIP archives with recent logs when available, falls back to single log file export

@Glavo Glavo merged commit 41fd38d into HMCL-dev:main Aug 10, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] 导出启动器日志时能一并打包最近几次的日志

4 participants