Repository navigation
Conversation
ZZZank
force-pushed
the
log-retention-migration
branch
from
November 19, 2026 07:40
0aef49a to
98631ad
Compare
Contributor
Author
Contributor
|
Link #7319 ? |
3gf8jv4dv
reviewed
Nov 20, 2026
Contributor
|
刚才迷糊了 |
Co-authored-by: 3gf8jv4dv <[email protected]>
Minecraft269
suggested changes
Nov 20, 2026
| settings.launcher.launcher_log.export.success=Logs have been exported to "%s". | ||
| settings.launcher.launcher_log.reveal=Reveal Logs in File Manager | ||
| settings.launcher.launcher_log.retention=Log Retention | ||
| settings.launcher.launcher_log.retention.subtitle=Older logs are deleted when the launcher exits. |
Contributor
There was a problem hiding this comment.
刚才迷糊了
Should RollBack.
Suggested change
| settings.launcher.launcher_log.retention.subtitle=Older logs are deleted when the launcher exits. | |
| settings.launcher.launcher_log.retention.subtitle=Older Launcher logs are deleted when the launcher exits. |
| settings.launcher.launcher_log.retention.subtitle=Older logs are deleted when the launcher exits. | ||
| settings.launcher.launcher_log.retention.count=%d Logs | ||
| settings.launcher.launcher_log.retention.keep_all=Keep All | ||
| settings.launcher.launcher_log.retention.keep_all.subtitle=Older logs are not deleted automatically. |
Contributor
There was a problem hiding this comment.
And more Change Suggestion.
Suggested change
| settings.launcher.launcher_log.retention.keep_all.subtitle=Older logs are not deleted automatically. | |
| settings.launcher.launcher_log.retention.keep_all.subtitle=Older Launcher logs are not deleted automatically. |
CC @3gf8jv4dv review, reasonable?
Contributor
|
@Minecraft269 这样的话,我感觉可以给 |
Contributor
感觉可以 CC @ZZZank |
Contributor
Author
|
我又看了看已有的几条lang, |
Contributor
看看3gf怎么说吧 我也不是这方面专业的 CC @3gf8jv4dv |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


问题描述与来源分析请看issue:#7319
这个PR的第一个提交更改了
logRetention与日志保留数量的对应逻辑:先前是0或者负数代表关闭org.jackhuang.hmcl.util.logging.Logger里的旧日志自动清理,整数表示保留的旧日志数量;现在则是负数代表关闭旧日志清理,正数表示保留的旧日志数量,0被重定向到logRetention的默认值,从而让从旧配置迁移到新配置的用户不会因为旧的默认值0而让启动器的旧日志清理功能自动失效。第二个提交添加了一个GUI配置项,允许用户通过启动器界面修改日志保留数量,点“重置”可以恢复到默认值(20):
以下是几个写代码时的设计决策,review时可能有用:
logRetention,甚至根本不知道这个配置,因此更改语义应该是安全的。logRetention内部是因为如果不这样就要引入UserSettings.getLogRetention()或类似物,不太符合惯例,而放在Logger就需要Logger自己也硬编码新旧的默认值。Fixes #7319