diff --git a/src/main/java/fr/xephi/authme/ConsoleLogger.java b/src/main/java/fr/xephi/authme/ConsoleLogger.java index eca20fbba..acdae309a 100644 --- a/src/main/java/fr/xephi/authme/ConsoleLogger.java +++ b/src/main/java/fr/xephi/authme/ConsoleLogger.java @@ -1,6 +1,7 @@ package fr.xephi.authme; import com.google.common.base.Throwables; +import fr.xephi.authme.settings.properties.SecuritySettings; import fr.xephi.authme.util.StringUtils; import java.io.File; @@ -48,6 +49,15 @@ public final class ConsoleLogger { } } + public static void debug(String message) { + if (!AuthMe.getInstance().getSettings().getProperty(SecuritySettings.REMOVE_SPAM_FROM_CONSOLE)) { + logger.fine(message); + if (useLogging) { + writeLog("Debug: " + message); + } + } + } + /** * Print an error message. * diff --git a/src/main/java/fr/xephi/authme/cache/auth/PlayerCache.java b/src/main/java/fr/xephi/authme/cache/auth/PlayerCache.java index 17cdca55e..9914ee3fa 100644 --- a/src/main/java/fr/xephi/authme/cache/auth/PlayerCache.java +++ b/src/main/java/fr/xephi/authme/cache/auth/PlayerCache.java @@ -1,5 +1,7 @@ package fr.xephi.authme.cache.auth; +import fr.xephi.authme.ConsoleLogger; + import java.util.concurrent.ConcurrentHashMap; /** @@ -22,6 +24,7 @@ public class PlayerCache { if (singleton == null) { singleton = new PlayerCache(); } + return singleton; } @@ -31,6 +34,7 @@ public class PlayerCache { * @param auth PlayerAuth */ public void addPlayer(PlayerAuth auth) { + ConsoleLogger.debug("ADDED PLAYER TO CACHE " + auth.getNickname()); cache.put(auth.getNickname().toLowerCase(), auth); } @@ -40,6 +44,7 @@ public class PlayerCache { * @param auth PlayerAuth */ public void updatePlayer(PlayerAuth auth) { + ConsoleLogger.debug("UPDATE PLAYER " + auth.getNickname()); cache.put(auth.getNickname(), auth); } @@ -49,6 +54,7 @@ public class PlayerCache { * @param user String */ public void removePlayer(String user) { + ConsoleLogger.debug("REMOVE PLAYER " + user); cache.remove(user.toLowerCase()); } diff --git a/src/main/java/fr/xephi/authme/datasource/CacheDataSource.java b/src/main/java/fr/xephi/authme/datasource/CacheDataSource.java index 6aad92b2c..7765e61dd 100644 --- a/src/main/java/fr/xephi/authme/datasource/CacheDataSource.java +++ b/src/main/java/fr/xephi/authme/datasource/CacheDataSource.java @@ -53,6 +53,7 @@ public class CacheDataSource implements DataSource { return executorService.submit(new Callable>() { @Override public Optional call() { + ConsoleLogger.debug("REFRESH " + key); return load(key); } });