Removed some string concatenation in logger

This commit is contained in:
themode 2020-12-14 05:42:22 +01:00
parent 8a2e69f709
commit 22cd7a28a7
3 changed files with 9 additions and 10 deletions

View File

@ -726,7 +726,7 @@ public final class MinecraftServer {
extensionManager.getExtensions().forEach(Extension::postInitialize);
final double loadTime = MathUtils.round((t1 + System.nanoTime()) / 1_000_000D, 2);
LOGGER.info("Extensions loaded in " + loadTime + "ms");
LOGGER.info("Extensions loaded in {}ms", loadTime);
LOGGER.info("Minestom server started successfully.");
}

View File

@ -321,14 +321,13 @@ public class ExtensionManager {
// Check if there are cyclic extensions.
if (!dependencyMap.isEmpty()) {
LOGGER.error("Minestom found " + dependencyMap.size() + " cyclic extensions.");
LOGGER.error("Minestom found {} cyclic extensions.", dependencyMap.size());
LOGGER.error("Cyclic extensions depend on each other and can therefore not be loaded.");
for (Map.Entry<DiscoveredExtension, List<DiscoveredExtension>> entry : dependencyMap.entrySet()) {
DiscoveredExtension discoveredExtension = entry.getKey();
LOGGER.error(discoveredExtension.getName() + " could not be loaded, as it depends on: "
+ entry.getValue().stream().map(DiscoveredExtension::getName).collect(Collectors.joining(", "))
+ "."
);
LOGGER.error("{} could not be loaded, as it depends on: {}.",
discoveredExtension.getName(),
entry.getValue().stream().map(DiscoveredExtension::getName).collect(Collectors.joining(", ")));
}
}
@ -451,7 +450,7 @@ public class ExtensionManager {
private void setupCodeModifiers(@NotNull List<DiscoveredExtension> extensions) {
final ClassLoader cl = getClass().getClassLoader();
if (!(cl instanceof MinestomRootClassLoader)) {
LOGGER.warn("Current class loader is not a MinestomOverwriteClassLoader, but " + cl + ". This disables code modifiers (Mixin support is therefore disabled)");
LOGGER.warn("Current class loader is not a MinestomOverwriteClassLoader, but {}. This disables code modifiers (Mixin support is therefore disabled)", cl);
return;
}
MinestomRootClassLoader modifiableClassLoader = (MinestomRootClassLoader) cl;
@ -464,7 +463,7 @@ public class ExtensionManager {
if (!extension.getMixinConfig().isEmpty()) {
final String mixinConfigFile = extension.getMixinConfig();
Mixins.addConfiguration(mixinConfigFile);
LOGGER.info("Found mixin in extension " + extension.getName() + ": " + mixinConfigFile);
LOGGER.info("Found mixin in extension {}: {}", extension.getName(), mixinConfigFile);
}
} catch (Exception e) {
e.printStackTrace();

View File

@ -39,7 +39,7 @@ public class EncryptionResponsePacket implements ClientPreplayPacket {
try {
final String loginUsername = nettyConnection.getLoginUsername();
if (!Arrays.equals(nettyConnection.getNonce(), getNonce())) {
MinecraftServer.LOGGER.error(loginUsername + " tried to login with an invalid nonce!");
MinecraftServer.LOGGER.error("{} tried to login with an invalid nonce!", loginUsername);
return;
}
if (!loginUsername.isEmpty()) {
@ -48,7 +48,7 @@ public class EncryptionResponsePacket implements ClientPreplayPacket {
if (digestedData == null) {
// Incorrect key, probably because of the client
MinecraftServer.LOGGER.error("Connection " + nettyConnection.getRemoteAddress() + " failed initializing encryption.");
MinecraftServer.LOGGER.error("Connection {} failed initializing encryption.", nettyConnection.getRemoteAddress());
connection.disconnect();
return;
}