Skip to content

Commit

Permalink
loggers
Browse files Browse the repository at this point in the history
  • Loading branch information
KrLite committed Jul 12, 2024
1 parent 22151f2 commit 5340ada
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public List<String> load() {
return loadFromFile();
} catch (Exception exception) {
if (!(Splasher.CONFIG.get().texts.randomRate == SplasherConfig.RandomRate.JEB)) {
Splasher.LOGGER.debug("Failed to load custom splash texts: ", exception);
Splasher.LOGGER.error("Failed to load custom splash texts: ", exception);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ private void get(CallbackInfoReturnable<SplashTextRenderer> cir) {
if (!enabled || (!source.vanilla() && !source.custom())) {
// Has nothing
cir.setReturnValue(null);
if (Splasher.CONFIG.get().debugInfoEnabled) Splasher.LOGGER.warn("Splash mode: " + source.name());
if (Splasher.CONFIG.get().debugInfoEnabled) {
Splasher.LOGGER.info("Splash mode: {}", source.name());
}
return;
}

Expand All @@ -52,22 +54,32 @@ private void get(CallbackInfoReturnable<SplashTextRenderer> cir) {
if (source.vanilla() && !source.custom() && !localized) {
// Pure vanilla
cir.cancel();
if (Splasher.CONFIG.get().debugInfoEnabled) Splasher.LOGGER.info("Splash mode: " + source.name() + " (raw)");
if (Splasher.CONFIG.get().debugInfoEnabled) {
Splasher.LOGGER.info("Splash mode: {} (raw)", source.name());
}
return;
}

String splashText = SplashTextSupplier.getSplashes(session, splashTexts);
cir.setReturnValue(new SplashTextRenderer(splashText == null ? "" : splashText));

if (Splasher.CONFIG.get().debugInfoEnabled && !(Splasher.CONFIG.get().texts.randomRate == SplasherConfig.RandomRate.JEB)) {
if (localized) Splasher.LOGGER.info("Splash mode: " + source.name());
else Splasher.LOGGER.info("Splash mode: " + source.name() + " (raw)");
if (Splasher.CONFIG.get().debugInfoEnabled) {
if (Splasher.CONFIG.get().debugInfoEnabled && !(Splasher.CONFIG.get().texts.randomRate == SplasherConfig.RandomRate.JEB)) {
if (localized) {
Splasher.LOGGER.info("Splash mode: {}", source.name());
} else {
Splasher.LOGGER.info("Splash mode: {} (raw)", source.name());
}

if (splashText != null) Splasher.LOGGER.info(
"Loaded splash: '" + splashText + "' in language "
+ (!localized ? "en_us" : MinecraftClient.getInstance().getLanguageManager().getLanguage()) + "."
);
else Splasher.LOGGER.warn("Loaded empty splash.");
if (splashText != null) {
Splasher.LOGGER.info(
"Loaded splash text: '" + splashText + "' in language "
+ (!localized ? "en_us" : MinecraftClient.getInstance().getLanguageManager().getLanguage()) + "."
);
} else {
Splasher.LOGGER.warn("Loaded empty splash text.");
}
}
}
}
}

0 comments on commit 5340ada

Please sign in to comment.