Migrate SLF4J logging (Fixes #177)
This commit is contained in:
20 files changed
+99
-78
No files matched your search
@@ -3,6 +3,7 @@ package com.github.games647.fastlogin.bungee;
|
||||
import com.github.games647.fastlogin.bungee.hooks.BungeeAuthHook;
|
||||
import com.github.games647.fastlogin.bungee.listener.ConnectListener;
|
||||
import com.github.games647.fastlogin.bungee.listener.MessageListener;
|
||||
import com.github.games647.fastlogin.core.CommonUtil;
|
||||
import com.github.games647.fastlogin.core.mojang.MojangApiConnector;
|
||||
import com.github.games647.fastlogin.core.shared.FastLoginCore;
|
||||
import com.github.games647.fastlogin.core.shared.PlatformPlugin;
|
||||
@@ -20,12 +21,15 @@ import net.md_5.bungee.api.connection.ProxiedPlayer;
|
||||
import net.md_5.bungee.api.plugin.Plugin;
|
||||
import net.md_5.bungee.api.scheduler.GroupedThreadFactory;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
|
||||
/**
|
||||
* BungeeCord version of FastLogin. This plugin keeps track on online mode connections.
|
||||
*/
|
||||
public class FastLoginBungee extends Plugin implements PlatformPlugin<CommandSender> {
|
||||
|
||||
private final ConcurrentMap<PendingConnection, BungeeLoginSession> session = Maps.newConcurrentMap();
|
||||
private final Logger logger = CommonUtil.createLoggerFromJDK(getLogger());
|
||||
|
||||
private FastLoginCore<ProxiedPlayer, CommandSender, FastLoginBungee> core;
|
||||
|
||||
@@ -66,7 +70,7 @@ public class FastLoginBungee extends Plugin implements PlatformPlugin<CommandSen
|
||||
Plugin plugin = getProxy().getPluginManager().getPlugin("BungeeAuth");
|
||||
if (plugin != null) {
|
||||
core.setAuthPluginHook(new BungeeAuthHook());
|
||||
getLogger().info("Hooked into BungeeAuth");
|
||||
logger.info("Hooked into BungeeAuth");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,6 +79,11 @@ public class FastLoginBungee extends Plugin implements PlatformPlugin<CommandSen
|
||||
return getDescription().getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Logger getLog() {
|
||||
return logger;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendMessage(CommandSender receiver, String message) {
|
||||
receiver.sendMessage(TextComponent.fromLegacyText(message));
|
||||
@@ -88,6 +97,6 @@ public class FastLoginBungee extends Plugin implements PlatformPlugin<CommandSen
|
||||
|
||||
@Override
|
||||
public MojangApiConnector makeApiConnector(List<String> addresses, int requests, List<HostAndPort> proxies) {
|
||||
return new MojangApiConnector(getLogger(), addresses, requests, proxies);
|
||||
return new MojangApiConnector(getLog(), addresses, requests, proxies);
|
||||
}
|
||||
}
|
||||
+1
-2
@@ -9,7 +9,6 @@ import com.google.common.base.Charsets;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.UUID;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import net.md_5.bungee.api.ProxyServer;
|
||||
import net.md_5.bungee.api.connection.PendingConnection;
|
||||
@@ -82,7 +81,7 @@ public class ConnectListener implements Listener {
|
||||
idField.setAccessible(true);
|
||||
idField.set(connection, offlineUUID);
|
||||
} catch (NoSuchFieldException | IllegalAccessException ex) {
|
||||
plugin.getLogger().log(Level.SEVERE, "Failed to set offline uuid", ex);
|
||||
plugin.getLog().error("Failed to set offline uuid", ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user