Fix removePassword option not working on KCauldron.

This commit is contained in:
DNx5 2016-03-31 19:16:05 +07:00
parent 6132743913
commit 0fc15b8105
2 changed files with 5 additions and 9 deletions

View File

@ -624,11 +624,13 @@ public class AuthMe extends JavaPlugin {
// Set the console filter to remove the passwords
private void setLog4JFilter() {
Bukkit.getScheduler().scheduleSyncDelayedTask(this, new Runnable() {
@Override
public void run() {
org.apache.logging.log4j.core.Logger coreLogger = (org.apache.logging.log4j.core.Logger) LogManager.getRootLogger();
coreLogger.addFilter(new Log4JFilter());
org.apache.logging.log4j.core.Logger logger;
logger = (org.apache.logging.log4j.core.Logger) LogManager.getRootLogger();
logger.addFilter(new Log4JFilter());
logger = (org.apache.logging.log4j.core.Logger) LogManager.getLogger("net.minecraft");
logger.addFilter(new Log4JFilter());
}
});
}

View File

@ -51,9 +51,6 @@ public class Log4JFilter implements Filter {
@Override
public Result filter(LogEvent record) {
if (record == null) {
return Result.NEUTRAL;
}
return validateMessage(record.getMessage());
}
@ -64,9 +61,6 @@ public class Log4JFilter implements Filter {
@Override
public Result filter(Logger arg0, Level arg1, Marker arg2, Object message, Throwable arg4) {
if (message == null) {
return Result.NEUTRAL;
}
return validateMessage(message.toString());
}