在一些地方插入些log (#2325)
This commit is contained in:
@@ -258,6 +258,7 @@ public final class Launcher extends Application {
|
|||||||
LOG.info("HMCL Directory: " + Metadata.HMCL_DIRECTORY);
|
LOG.info("HMCL Directory: " + Metadata.HMCL_DIRECTORY);
|
||||||
LOG.info("HMCL Jar Path: " + JarUtils.thisJar().map(it -> it.toAbsolutePath().toString()).orElse("Not Found"));
|
LOG.info("HMCL Jar Path: " + JarUtils.thisJar().map(it -> it.toAbsolutePath().toString()).orElse("Not Found"));
|
||||||
LOG.info("Memory: " + Runtime.getRuntime().maxMemory() / 1024 / 1024 + "MB");
|
LOG.info("Memory: " + Runtime.getRuntime().maxMemory() / 1024 / 1024 + "MB");
|
||||||
|
LOG.info("Physical memory: " + OperatingSystem.TOTAL_MEMORY + " MB");
|
||||||
LOG.info("Metaspace: " + ManagementFactory.getMemoryPoolMXBeans().stream()
|
LOG.info("Metaspace: " + ManagementFactory.getMemoryPoolMXBeans().stream()
|
||||||
.filter(bean -> bean.getName().equals("Metaspace"))
|
.filter(bean -> bean.getName().equals("Metaspace"))
|
||||||
.findAny()
|
.findAny()
|
||||||
|
|||||||
@@ -155,6 +155,7 @@ public class GameCrashWindow extends Stage {
|
|||||||
boolean hasMultipleRules = results.stream().map(CrashReportAnalyzer.Result::getRule).distinct().count() > 1;
|
boolean hasMultipleRules = results.stream().map(CrashReportAnalyzer.Result::getRule).distinct().count() > 1;
|
||||||
if (hasMultipleRules) {
|
if (hasMultipleRules) {
|
||||||
segments.addAll(FXUtils.parseSegment(i18n("game.crash.reason.multiple"), Controllers::onHyperlinkAction));
|
segments.addAll(FXUtils.parseSegment(i18n("game.crash.reason.multiple"), Controllers::onHyperlinkAction));
|
||||||
|
LOG.log(Level.INFO, "Multiple reasons detected");
|
||||||
}
|
}
|
||||||
|
|
||||||
for (CrashReportAnalyzer.Result result : results) {
|
for (CrashReportAnalyzer.Result result : results) {
|
||||||
@@ -191,12 +192,15 @@ public class GameCrashWindow extends Stage {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
segments.add(new Text("\n"));
|
segments.add(new Text("\n"));
|
||||||
|
LOG.log(Level.INFO, "Crash cause: " + result.getRule());
|
||||||
}
|
}
|
||||||
if (results.isEmpty()) {
|
if (results.isEmpty()) {
|
||||||
if (!keywords.isEmpty()) {
|
if (!keywords.isEmpty()) {
|
||||||
reasonTextFlow.getChildren().setAll(new Text(i18n("game.crash.reason.stacktrace", String.join(", ", keywords))));
|
reasonTextFlow.getChildren().setAll(new Text(i18n("game.crash.reason.stacktrace", String.join(", ", keywords))));
|
||||||
|
LOG.log(Level.INFO, "Crash reason unknown, but some log keywords have been found: " + String.join(", ", keywords));
|
||||||
} else {
|
} else {
|
||||||
reasonTextFlow.getChildren().setAll(FXUtils.parseSegment(i18n("game.crash.reason.unknown"), Controllers::onHyperlinkAction));
|
reasonTextFlow.getChildren().setAll(FXUtils.parseSegment(i18n("game.crash.reason.unknown"), Controllers::onHyperlinkAction));
|
||||||
|
LOG.log(Level.INFO, "Crash reason unknown");
|
||||||
}
|
}
|
||||||
|
|
||||||
feedbackTextFlow.setVisible(true);
|
feedbackTextFlow.setVisible(true);
|
||||||
|
|||||||
Reference in New Issue
Block a user