From 6a3a5a0458dd0a2bffb93f31768a03b090eec5ff Mon Sep 17 00:00:00 2001 From: kashike Date: Sun, 12 Aug 2018 01:33:39 -0700 Subject: [PATCH] minor shuffle to log messages --- .../java/com/velocitypowered/natives/util/Natives.java | 8 ++++---- .../com/velocitypowered/network/ConnectionManager.java | 5 +++-- .../src/main/java/com/velocitypowered/proxy/Velocity.java | 6 ++++++ .../java/com/velocitypowered/proxy/VelocityServer.java | 5 ----- 4 files changed, 13 insertions(+), 11 deletions(-) diff --git a/native/src/main/java/com/velocitypowered/natives/util/Natives.java b/native/src/main/java/com/velocitypowered/natives/util/Natives.java index 2c055bd68..d1f3d2d48 100644 --- a/native/src/main/java/com/velocitypowered/natives/util/Natives.java +++ b/native/src/main/java/com/velocitypowered/natives/util/Natives.java @@ -40,18 +40,18 @@ public class Natives { public static final NativeCodeLoader compressor = new NativeCodeLoader<>( ImmutableList.of( new NativeCodeLoader.Variant<>(NativeCodeLoader.MACOS, - copyAndLoadNative("/macosx/velocity-compress.dylib"), "native compression (macOS)", + copyAndLoadNative("/macosx/velocity-compress.dylib"), "native (macOS)", NativeVelocityCompressor.FACTORY), new NativeCodeLoader.Variant<>(NativeCodeLoader.LINUX, - copyAndLoadNative("/linux_x64/velocity-compress.so"), "native compression (Linux amd64)", + copyAndLoadNative("/linux_x64/velocity-compress.so"), "native (Linux amd64)", NativeVelocityCompressor.FACTORY), - new NativeCodeLoader.Variant<>(NativeCodeLoader.ALWAYS, () -> {}, "Java compression", JavaVelocityCompressor.FACTORY) + new NativeCodeLoader.Variant<>(NativeCodeLoader.ALWAYS, () -> {}, "Java", JavaVelocityCompressor.FACTORY) ) ); public static final NativeCodeLoader cipher = new NativeCodeLoader<>( ImmutableList.of( - new NativeCodeLoader.Variant<>(NativeCodeLoader.ALWAYS, () -> {}, "Java cipher", JavaVelocityCipher.FACTORY) + new NativeCodeLoader.Variant<>(NativeCodeLoader.ALWAYS, () -> {}, "Java", JavaVelocityCipher.FACTORY) ) ); } diff --git a/proxy/src/main/java/com/velocitypowered/network/ConnectionManager.java b/proxy/src/main/java/com/velocitypowered/network/ConnectionManager.java index 35497a361..d4efdee5e 100644 --- a/proxy/src/main/java/com/velocitypowered/network/ConnectionManager.java +++ b/proxy/src/main/java/com/velocitypowered/network/ConnectionManager.java @@ -1,6 +1,7 @@ package com.velocitypowered.network; import com.google.common.util.concurrent.ThreadFactoryBuilder; +import com.velocitypowered.natives.util.Natives; import com.velocitypowered.proxy.connection.MinecraftConnection; import com.velocitypowered.proxy.connection.client.HandshakeSessionHandler; import com.velocitypowered.proxy.protocol.ProtocolConstants; @@ -68,7 +69,7 @@ public final class ConnectionManager { } private void logChannelInformation() { - logger.info("Using channel type {}", transportType); + logger.info("Connections will use {} channels, {} compression, {} ciphers", transportType, Natives.compressor.getLoadedVariant(), Natives.cipher.getLoadedVariant()); } public void bind(final InetSocketAddress address) { @@ -168,7 +169,7 @@ public final class ConnectionManager { KQUEUE(KQueueServerSocketChannel.class, KQueueSocketChannel.class, KQueueDatagramChannel.class) { @Override public EventLoopGroup createEventLoopGroup(boolean boss) { - String name = "Netty Kqueue " + (boss ? "Boss" : "Worker") + " #%d"; + String name = "Netty KQueue " + (boss ? "Boss" : "Worker") + " #%d"; return new KQueueEventLoopGroup(0, createThreadFactory(name)); } }; diff --git a/proxy/src/main/java/com/velocitypowered/proxy/Velocity.java b/proxy/src/main/java/com/velocitypowered/proxy/Velocity.java index e2ee28950..bc20a6059 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/Velocity.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/Velocity.java @@ -1,8 +1,12 @@ package com.velocitypowered.proxy; import com.velocitypowered.proxy.console.VelocityConsole; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; public class Velocity { + private static final Logger logger = LogManager.getLogger(Velocity.class); + static { // We use BufferedImage for favicons, and on macOS this puts the Java application in the dock. How inconvenient. // Force AWT to work with its head chopped off. @@ -10,6 +14,8 @@ public class Velocity { } public static void main(String... args) { + logger.info("Booting up Velocity..."); + final VelocityServer server = VelocityServer.getServer(); server.start(); diff --git a/proxy/src/main/java/com/velocitypowered/proxy/VelocityServer.java b/proxy/src/main/java/com/velocitypowered/proxy/VelocityServer.java index aea8c08ba..9102ce3fe 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/VelocityServer.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/VelocityServer.java @@ -97,11 +97,6 @@ public class VelocityServer implements ProxyServer { } public void start() { - logger.info("Using {}", Natives.compressor.getLoadedVariant()); - logger.info("Using {}", Natives.cipher.getLoadedVariant()); - - // Create a key pair - logger.info("Booting up Velocity..."); try { Path configPath = Paths.get("velocity.toml"); try {