Calling parent logger seems to work nowadays - closes #1071

This commit is contained in:
md_5 2014-06-24 18:21:13 +10:00
parent b9f2f3cfae
commit 81d83bdd8a

View File

@ -2,23 +2,23 @@ package net.md_5.bungee.api.plugin;
import java.util.logging.LogRecord; import java.util.logging.LogRecord;
import java.util.logging.Logger; import java.util.logging.Logger;
import net.md_5.bungee.api.ProxyServer;
public class PluginLogger extends Logger public class PluginLogger extends Logger
{ {
private String pluginName; private final String pluginName;
protected PluginLogger(Plugin plugin) protected PluginLogger(Plugin plugin)
{ {
super( plugin.getClass().getCanonicalName(), null ); super( plugin.getClass().getCanonicalName(), null );
pluginName = "[" + plugin.getDescription().getName() + "] "; pluginName = "[" + plugin.getDescription().getName() + "] ";
setParent( plugin.getProxy().getLogger() );
} }
@Override @Override
public void log(LogRecord logRecord) public void log(LogRecord logRecord)
{ {
logRecord.setMessage( pluginName + logRecord.getMessage() ); logRecord.setMessage( pluginName + logRecord.getMessage() );
ProxyServer.getInstance().getLogger().log( logRecord ); super.log( logRecord );
} }
} }