Remove outdated $() logger getter.

This commit is contained in:
md_5 2013-03-14 21:33:22 +11:00
parent 704fe11b05
commit bd479ba083
3 changed files with 16 additions and 27 deletions

View File

@ -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

View File

@ -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
{

View File

@ -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
{