Improved tick sync message suppression.

This commit is contained in:
sk89q 2011-02-05 14:00:06 -08:00
parent cc72d370ea
commit ce1a15e6ea
2 changed files with 7 additions and 2 deletions

View File

@ -25,8 +25,8 @@
public class TickSyncDelayLoggerFilter implements Filter {
public boolean isLoggable(LogRecord record) {
if (record.getMessage().equals("Can't keep up! Did the system time change, or is the server overloaded?")
&& record.getLevel() == Level.WARNING) {
if (record.getLevel() == Level.WARNING
&& record.getMessage().equals("Can't keep up! Did the system time change, or is the server overloaded?")) {
return false;
}

View File

@ -167,6 +167,11 @@ public WorldGuardPlugin(PluginLoader pluginLoader, Server instance,
if (suppressTickSyncWarnings) {
Logger.getLogger("Minecraft").setFilter(new TickSyncDelayLoggerFilter());
} else {
Filter filter = Logger.getLogger("Minecraft").getFilter();
if (filter != null && filter instanceof TickSyncDelayLoggerFilter) {
Logger.getLogger("Minecraft").setFilter(null);
}
}
}