mirror of
https://github.com/SpigotMC/BungeeCord.git
synced 2024-11-08 19:50:27 +01:00
Remove outdated $() logger getter.
This commit is contained in:
parent
704fe11b05
commit
bd479ba083
@ -27,7 +27,6 @@ import java.util.logging.Logger;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.Synchronized;
|
||||
import static net.md_5.bungee.Logger.$;
|
||||
import net.md_5.bungee.api.CommandSender;
|
||||
import net.md_5.bungee.api.ProxyServer;
|
||||
import net.md_5.bungee.api.ReconnectHandler;
|
||||
@ -142,7 +141,7 @@ public class BungeeCord extends ProxyServer
|
||||
|
||||
BungeeCord bungee = new BungeeCord();
|
||||
ProxyServer.setInstance( bungee );
|
||||
$().info( "Enabled BungeeCord version " + bungee.getVersion() );
|
||||
bungee.getLogger().info( "Enabled BungeeCord version " + bungee.getVersion() );
|
||||
bungee.start();
|
||||
|
||||
BufferedReader br = new BufferedReader( new InputStreamReader( System.in ) );
|
||||
@ -208,7 +207,7 @@ public class BungeeCord extends ProxyServer
|
||||
.bind().channel();
|
||||
listeners.add( server );
|
||||
|
||||
$().info( "Listening on " + info.getHost() );
|
||||
getLogger().info( "Listening on " + info.getHost() );
|
||||
}
|
||||
}
|
||||
|
||||
@ -216,13 +215,13 @@ public class BungeeCord extends ProxyServer
|
||||
{
|
||||
for ( Channel listener : listeners )
|
||||
{
|
||||
$().log( Level.INFO, "Closing listener {0}", listener );
|
||||
getLogger().log( Level.INFO, "Closing listener {0}", listener );
|
||||
try
|
||||
{
|
||||
listener.close().syncUninterruptibly();
|
||||
} catch ( ChannelException ex )
|
||||
{
|
||||
$().severe( "Could not close listen thread" );
|
||||
getLogger().severe( "Could not close listen thread" );
|
||||
}
|
||||
}
|
||||
listeners.clear();
|
||||
@ -234,28 +233,28 @@ public class BungeeCord extends ProxyServer
|
||||
this.isRunning = false;
|
||||
|
||||
stopListeners();
|
||||
$().info( "Closing pending connections" );
|
||||
getLogger().info( "Closing pending connections" );
|
||||
|
||||
$().info( "Disconnecting " + connections.size() + " connections" );
|
||||
getLogger().info( "Disconnecting " + connections.size() + " connections" );
|
||||
for ( UserConnection user : connections.values() )
|
||||
{
|
||||
user.disconnect( "Proxy restarting, brb." );
|
||||
}
|
||||
|
||||
$().info( "Closing IO threads" );
|
||||
getLogger().info( "Closing IO threads" );
|
||||
eventLoops.shutdown();
|
||||
|
||||
$().info( "Saving reconnect locations" );
|
||||
getLogger().info( "Saving reconnect locations" );
|
||||
reconnectHandler.save();
|
||||
saveThread.cancel();
|
||||
|
||||
$().info( "Disabling plugins" );
|
||||
getLogger().info( "Disabling plugins" );
|
||||
for ( Plugin plugin : pluginManager.getPlugins() )
|
||||
{
|
||||
plugin.onDisable();
|
||||
}
|
||||
|
||||
$().info( "Thank you and goodbye" );
|
||||
getLogger().info( "Thank you and goodbye" );
|
||||
System.exit( 0 );
|
||||
}
|
||||
|
||||
@ -287,7 +286,7 @@ public class BungeeCord extends ProxyServer
|
||||
@Override
|
||||
public Logger getLogger()
|
||||
{
|
||||
return $();
|
||||
return BungeeLogger.instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -8,17 +8,18 @@ import java.util.logging.FileHandler;
|
||||
import java.util.logging.Formatter;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.LogRecord;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
/**
|
||||
* Logger to handle formatting and storage of the proxy's logger.
|
||||
*/
|
||||
public class Logger extends java.util.logging.Logger
|
||||
public class BungeeLogger extends Logger
|
||||
{
|
||||
|
||||
private static final Formatter formatter = new ConsoleLogFormatter();
|
||||
private static final Logger instance = new Logger();
|
||||
static final BungeeLogger instance = new BungeeLogger();
|
||||
|
||||
public Logger()
|
||||
public BungeeLogger()
|
||||
{
|
||||
super( "BungeeCord", null );
|
||||
try
|
||||
@ -47,16 +48,6 @@ public class Logger extends java.util.logging.Logger
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the current logger instance.
|
||||
*
|
||||
* @return the current logger instance
|
||||
*/
|
||||
public static Logger $()
|
||||
{
|
||||
return instance;
|
||||
}
|
||||
|
||||
public static class ConsoleLogFormatter extends Formatter
|
||||
{
|
||||
|
@ -8,7 +8,6 @@ import java.io.UnsupportedEncodingException;
|
||||
import java.net.URL;
|
||||
import java.net.URLConnection;
|
||||
import java.net.URLEncoder;
|
||||
import static net.md_5.bungee.Logger.$;
|
||||
import net.md_5.bungee.api.ProxyServer;
|
||||
|
||||
public class Metrics extends Thread
|
||||
@ -55,7 +54,7 @@ public class Metrics extends Thread
|
||||
firstPost = false;
|
||||
} catch ( IOException ex )
|
||||
{
|
||||
$().info( "[Metrics] " + ex.getMessage() );
|
||||
ProxyServer.getInstance().getLogger().info( "[Metrics] " + ex.getMessage() );
|
||||
}
|
||||
try
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user