Bind logging of metrics errors to debug flag(s).

This commit is contained in:
asofold 2013-09-18 18:26:04 +02:00
parent 72e1ea8585
commit d896e9b25d

View File

@ -34,6 +34,8 @@ import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.PluginDescriptionFile; import org.bukkit.plugin.PluginDescriptionFile;
import org.bukkit.scheduler.BukkitTask; import org.bukkit.scheduler.BukkitTask;
import fr.neatmonster.nocheatplus.config.ConfPaths;
import fr.neatmonster.nocheatplus.config.ConfigManager;
import fr.neatmonster.nocheatplus.logging.LogUtil; import fr.neatmonster.nocheatplus.logging.LogUtil;
import java.io.BufferedReader; import java.io.BufferedReader;
@ -504,7 +506,9 @@ public class Metrics {
} else if (response.startsWith("7")) { } else if (response.startsWith("7")) {
response = response.substring(response.startsWith("7,") ? 2 : 1); response = response.substring(response.startsWith("7,") ? 2 : 1);
} }
LogUtil.scheduleLogWarning("[NoCheatPlus] Metrics error: " + response); // NCP: Log response. if (debug || ConfigManager.getConfigFile().getBoolean(ConfPaths.LOGGING_DEBUG)) { // NCP: Log response.
LogUtil.scheduleLogWarning("[NoCheatPlus] Metrics error: " + response);
}
throw new IOException(response); throw new IOException(response);
} else { } else {
// Is this the first update this hour? // Is this the first update this hour?