diff --git a/client/src/main/java/folk/sisby/switchy/client/SwitchyClient.java b/client/src/main/java/folk/sisby/switchy/client/SwitchyClient.java index fb1ad486..b13b9747 100644 --- a/client/src/main/java/folk/sisby/switchy/client/SwitchyClient.java +++ b/client/src/main/java/folk/sisby/switchy/client/SwitchyClient.java @@ -34,6 +34,6 @@ public void onInitializeClient() { ClientCommandRegistrationCallback.EVENT.register(SwitchyClientCommands::register); SwitchyClientEvents.registerEntrypointListeners(); SwitchyClientEvents.INIT.invoker().onInitialize(); - LOGGER.info("[Switchy Client] Initialized! Registered Modules: " + SwitchyClientModuleRegistry.getModules()); + LOGGER.info("[Switchy Client] Initialized! Registered Modules: {}", SwitchyClientModuleRegistry.getModules()); } } diff --git a/client/src/main/java/folk/sisby/switchy/client/api/module/SwitchyClientModuleRegistry.java b/client/src/main/java/folk/sisby/switchy/client/api/module/SwitchyClientModuleRegistry.java index be0ff81c..b1426534 100644 --- a/client/src/main/java/folk/sisby/switchy/client/api/module/SwitchyClientModuleRegistry.java +++ b/client/src/main/java/folk/sisby/switchy/client/api/module/SwitchyClientModuleRegistry.java @@ -32,7 +32,7 @@ public static void registerModule(Identifier id, Supplier m throw new IllegalArgumentException("Specified id is already registered"); } SUPPLIERS.put(id, moduleConstructor); - SwitchyClient.LOGGER.info("[Switchy Client] Registered client module " + id); + SwitchyClient.LOGGER.info("[Switchy Client] Registered client module {}", id); } /** diff --git a/compat/src/main/java/folk/sisby/switchy/modules/DrogtorModule.java b/compat/src/main/java/folk/sisby/switchy/modules/DrogtorModule.java index 9a08121b..dcac55a8 100644 --- a/compat/src/main/java/folk/sisby/switchy/modules/DrogtorModule.java +++ b/compat/src/main/java/folk/sisby/switchy/modules/DrogtorModule.java @@ -49,7 +49,7 @@ public void applyToPlayer(ServerPlayerEntity player) { drogtorPlayer.drogtor$setNickname(nickname); String newName = player.getDisplayName().getString(); if (!Objects.equals(oldName, newName)) - SwitchyCompat.LOGGER.info("[Switchy Compat] Player Nickname Change: '" + oldName + "' -> '" + newName + "' [" + player.getGameProfile().getName() + "]"); + SwitchyCompat.LOGGER.info("[Switchy Compat] Player Nickname Change: '{}' -> '{}' [{}]", oldName, newName, player.getGameProfile().getName()); drogtorPlayer.drogtor$setNameColor(nameColor); drogtorPlayer.drogtor$setBio(bio); } diff --git a/compat/src/main/java/folk/sisby/switchy/modules/FabricationArmorModule.java b/compat/src/main/java/folk/sisby/switchy/modules/FabricationArmorModule.java index c1afc289..d8c5e77c 100644 --- a/compat/src/main/java/folk/sisby/switchy/modules/FabricationArmorModule.java +++ b/compat/src/main/java/folk/sisby/switchy/modules/FabricationArmorModule.java @@ -107,7 +107,7 @@ public void fillFromNbt(NbtCompound nbt) { for (int i = 0; i < nbtList.size(); i++) { EquipmentSlot slot = Enums.getIfPresent(EquipmentSlot.class, nbtList.getString(i).toUpperCase(Locale.ROOT)).orNull(); if (slot == null) { - SwitchyCompat.LOGGER.warn("[Switchy Compat] Unrecognized slot " + nbtList.getString(i) + " while loading profile"); + SwitchyCompat.LOGGER.warn("[Switchy Compat] Unrecognized slot {} while loading profile", nbtList.getString(i)); } else { suppressedSlots.add(slot); } diff --git a/compat/src/main/java/folk/sisby/switchy/modules/StyledNicknamesModule.java b/compat/src/main/java/folk/sisby/switchy/modules/StyledNicknamesModule.java index 50aa591a..62fbbc44 100644 --- a/compat/src/main/java/folk/sisby/switchy/modules/StyledNicknamesModule.java +++ b/compat/src/main/java/folk/sisby/switchy/modules/StyledNicknamesModule.java @@ -68,7 +68,7 @@ public void applyToPlayer(ServerPlayerEntity player) { if (styled_nickname != null) holder.sn_set(styled_nickname, false); String newName = player.getDisplayName().getString(); if (!Objects.equals(oldName, newName)) - SwitchyCompat.LOGGER.info("[Switchy] Player Nickname Change: '" + oldName + "' -> '" + newName + "' [" + player.getGameProfile().getName() + "]"); + SwitchyCompat.LOGGER.info("[Switchy Compat] Player Nickname Change: '{}' -> '{}' [{}]", oldName, newName, player.getGameProfile().getName()); } @Override diff --git a/core/src/main/java/folk/sisby/switchy/Switchy.java b/core/src/main/java/folk/sisby/switchy/Switchy.java index 8ff88523..04bf8f01 100644 --- a/core/src/main/java/folk/sisby/switchy/Switchy.java +++ b/core/src/main/java/folk/sisby/switchy/Switchy.java @@ -41,7 +41,7 @@ public void onInitialize() { ServerPlayConnectionEvents.DISCONNECT.register(SwitchyPlayConnectionListener::onPlayDisconnect); SwitchyEvents.registerEntrypointListeners(); SwitchyEvents.INIT.invoker().onInitialize(); - Switchy.LOGGER.info("[Switchy] Initialized! Registered Modules: " + SwitchyModuleRegistry.getModules()); + Switchy.LOGGER.info("[Switchy] Initialized! Registered Modules: {}", SwitchyModuleRegistry.getModules()); } @Override diff --git a/core/src/main/java/folk/sisby/switchy/api/module/SwitchyModuleRegistry.java b/core/src/main/java/folk/sisby/switchy/api/module/SwitchyModuleRegistry.java index 1a2aae10..3ebf24bf 100644 --- a/core/src/main/java/folk/sisby/switchy/api/module/SwitchyModuleRegistry.java +++ b/core/src/main/java/folk/sisby/switchy/api/module/SwitchyModuleRegistry.java @@ -61,7 +61,7 @@ public static void registerModule(Identifier id, Supplier moduleC } else { Switchy.CONFIG.moduleEditableReadOnly.put(id.toString(), moduleInfo.editable()); } - Switchy.LOGGER.info("[Switchy] Registered module " + id); + Switchy.LOGGER.info("[Switchy] Registered module {}", id); } /** diff --git a/core/src/main/java/folk/sisby/switchy/presets/SwitchyPresetImpl.java b/core/src/main/java/folk/sisby/switchy/presets/SwitchyPresetImpl.java index 901f06c8..29f79345 100644 --- a/core/src/main/java/folk/sisby/switchy/presets/SwitchyPresetImpl.java +++ b/core/src/main/java/folk/sisby/switchy/presets/SwitchyPresetImpl.java @@ -37,8 +37,7 @@ static void tryApplyModule(Map modules, Identifier id SwitchyModuleRegistry.getApplyDependencies(id).forEach((depId) -> tryApplyModule(modules, depId, player, registeredModules)); module.applyToPlayer(player); } catch (Exception ex) { - Switchy.LOGGER.error("[Switchy] Module " + id + " failed to apply! Error:"); - Switchy.LOGGER.error(ex.toString()); + Switchy.LOGGER.error("[Switchy] Module {} failed to update! Error:", id, ex); } registeredModules.add(id); } @@ -50,8 +49,7 @@ public void updateFromPlayer(ServerPlayerEntity player, String nextPreset) { try { module.updateFromPlayer(player, nextPreset); } catch (Exception ex) { - Switchy.LOGGER.error("[Switchy] Module " + id + " failed to update! Error:"); - Switchy.LOGGER.error(ex.toString()); + Switchy.LOGGER.error("[Switchy] Module {} failed to update! Error:", id, ex); } }); } diff --git a/core/src/main/java/folk/sisby/switchy/presets/SwitchyPresetsDataImpl.java b/core/src/main/java/folk/sisby/switchy/presets/SwitchyPresetsDataImpl.java index 7e649b0c..19d84772 100644 --- a/core/src/main/java/folk/sisby/switchy/presets/SwitchyPresetsDataImpl.java +++ b/core/src/main/java/folk/sisby/switchy/presets/SwitchyPresetsDataImpl.java @@ -182,7 +182,7 @@ void toggleModulesFromNbt(NbtList list, Boolean enabled, Boolean silent) { modules.put(id, enabled); } else if (!silent) { logger.warn("[Switchy] Unable to toggle a module - Was a module unloaded?"); - logger.warn("[Switchy] Key: " + e.asString()); + logger.warn("[Switchy] Key: {}", e.asString()); if (id != null) { logger.warn("[Switchy] Saved as lost puppy {} module.", enabled ? "enabled" : "disabled"); backup.put(id, enabled); diff --git a/core/src/main/java/folk/sisby/switchy/presets/SwitchyPresetsImpl.java b/core/src/main/java/folk/sisby/switchy/presets/SwitchyPresetsImpl.java index 5c4dce13..23db8020 100644 --- a/core/src/main/java/folk/sisby/switchy/presets/SwitchyPresetsImpl.java +++ b/core/src/main/java/folk/sisby/switchy/presets/SwitchyPresetsImpl.java @@ -130,7 +130,7 @@ public String switchCurrentPreset(ServerPlayerEntity player, String name) throws ); setCurrentPreset(nextPreset.getName()); SwitchyEvents.SWITCH.invoker().onSwitch(player, switchEvent); - LOGGER.info("[Switchy] Player switch: '" + oldPreset.getName() + "' -> '" + getCurrentPresetName() + "' [" + player.getGameProfile().getName() + "]"); + LOGGER.info("[Switchy] Player switch: '{}' -> '{}' [{}]", oldPreset.getName(), getCurrentPresetName(), player.getGameProfile().getName()); return getCurrentPresetName(); }