-
Notifications
You must be signed in to change notification settings - Fork 775
添加输出游戏调试日志选项 #4144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
添加输出游戏调试日志选项 #4144
Conversation
关于 log4j,我们正在考虑是否可以不再打包 log4j2.xml,而是遵循默认的配置。 |
Co-authored-by: 3gf8jv4dv <[email protected]>
我觉得这个选项名字不是很好,叫「输出调试日志」可能会更合适。而且我感觉它应该放在「查看日志」的下面,而不是高级选项里。 |
FXUtils.unbind(txtServerIP, lastVersionSetting.serverIpProperty()); | ||
chkAutoAllocate.selectedProperty().unbindBidirectional(lastVersionSetting.autoMemoryProperty()); | ||
chkFullscreen.selectedProperty().unbindBidirectional(lastVersionSetting.fullscreenProperty()); | ||
useDebugLogOutputPane.selectedProperty().unbindBidirectional(versionSetting.useDebugLogOutputProperty()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
你这里 unbind 错东西了。unbind 的目标应该是 lastVersionSetting
的属性,而不是 versionSetting
的属性 。
# Conflicts: # HMCLCore/src/main/java/org/jackhuang/hmcl/launch/DefaultLauncher.java
InputStream source; | ||
if (GameVersionNumber.asGameVersion(repository.getGameVersion(version)).compareTo("1.12") < 0) { | ||
if (options.isShowDebugLog()) { | ||
source = DefaultLauncher.class.getResourceAsStream("/assets/game/log4j2-debug.xml"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
你确定你的这个配置文件对 Minecraft 1.7+ 都生效吗?我怎么看到这个文件里用了高版本 Log4j 才有的功能?
String sourcePath = "/assets/game/log4j2-"; | ||
|
||
if (GameVersionNumber.asGameVersion(repository.getGameVersion(version)).compareTo("1.12") < 0) { | ||
sourcePath += "1.7"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不建议使用 +=
拼接字符串,应当用 StringBuilder
来拼接。
Co-authored-by: 3gf8jv4dv <[email protected]>
在崩溃群排查错误的过程中,因为 HMCL 给游戏提供的
log4j2.xml
可能会丢失一些需要的信息,需要用户手动替换一个日志级别低的 log4j2 文件让用户自己操作非常容易出错且沟通成本高,因此需要一个快捷选项方便用户使用。本 PR 在游戏高级设置里添加了相关选项,可以一键切换到预设的低级别 log4j2 配置文件
