Move logging.debug config path, don't log "consistency checks run".

Move logging.debug to logging.extended.status, because that section will
contain more entries, e.g. for logging all violations.
This commit is contained in:
asofold 2015-01-25 03:18:24 +01:00
parent 1bc280eee5
commit be68ecba60
4 changed files with 26 additions and 21 deletions

View File

@ -221,7 +221,7 @@ public class BridgeHealth {
private static void checkLogEntry(final String tag) {
// New entry.
if (ConfigManager.getConfigFile().getBoolean(ConfPaths.LOGGING_DEBUG)){
if (ConfigManager.getConfigFile().getBoolean(ConfPaths.LOGGING_EXTENDED_STATUS)){
StaticLog.logWarning("[NoCheatPlus] API incompatibility detected: " + tag);
}
}

View File

@ -28,7 +28,6 @@ public abstract class ConfPaths {
@GlobalConfig
private static final String LOGGING = "logging.";
public static final String LOGGING_ACTIVE = LOGGING + "active";
public static final String LOGGING_DEBUG = LOGGING + "debug";
public static final String LOGGING_MAXQUEUESIZE = LOGGING + "maxqueuesize";
private static final String LOGGING_BACKEND = LOGGING + "backend.";
@ -45,6 +44,9 @@ public abstract class ConfPaths {
public static final String LOGGING_BACKEND_INGAMECHAT_SUBSCRIPTIONS = LOGGING_BACKEND_INGAMECHAT + "subscriptions";
public static final String LOGGING_BACKEND_INGAMECHAT_PREFIX = LOGGING_BACKEND_INGAMECHAT + "prefix";
private static final String LOGGING_EXTENDED = LOGGING + "extended.";
public static final String LOGGING_EXTENDED_STATUS = LOGGING_EXTENDED + "status";
@GlobalConfig
private static final String MISCELLANEOUS = "miscellaneous.";
//public static final String MISCELLANEOUS_CHECKFORUPDATES = MISCELLANEOUS + "checkforupdates";
@ -631,23 +633,25 @@ public abstract class ConfPaths {
@Moved(newPath = LOGGING_BACKEND_INGAMECHAT_ACTIVE)
public static final String LOGGING_INGAMECHAT = "logging.ingamechat";
@Moved(newPath = LOGGING_BACKEND_INGAMECHAT_SUBSCRIPTIONS)
public static final String LOGGING_USESUBSCRIPTIONS = "logging.usesubscriptions";
public static final String LOGGING_USESUBSCRIPTIONS = "logging.usesubscriptions";
@Moved(newPath = PROTECT_PLUGINS_HIDE_ACTIVE)
public static final String MISCELLANEOUS_PROTECTPLUGINS = "miscellaneous.protectplugins";
public static final String MISCELLANEOUS_PROTECTPLUGINS = "miscellaneous.protectplugins";
@Moved(newPath = PROTECT_CLIENTS_MOTD_ALLOWALL)
public static final String MISCELLANEOUS_ALLOWCLIENTMODS = "miscellaneous.allowclientmods";
public static final String MISCELLANEOUS_ALLOWCLIENTMODS = "miscellaneous.allowclientmods";
@Moved(newPath = PROTECT_PLUGINS_HIDE_NOCOMMAND_MSG)
public static final String PROTECT_PLUGINS_HIDE_MSG_NOCOMMAND = "protection.plugins.hide.messages.unknowncommand";
public static final String PROTECT_PLUGINS_HIDE_MSG_NOCOMMAND = "protection.plugins.hide.messages.unknowncommand";
@Moved(newPath = PROTECT_PLUGINS_HIDE_NOPERMISSION_MSG)
public static final String PROTECT_PLUGINS_HIDE_MSG_NOPERMISSION = "protection.plugins.hide.messages.nopermission";
public static final String PROTECT_PLUGINS_HIDE_MSG_NOPERMISSION = "protection.plugins.hide.messages.nopermission";
@Moved(newPath = PROTECT_COMMANDS_CONSOLEONLY_ACTIVE)
public static final String MISCELLANEOUS_OPINCONSOLEONLY = "miscellaneous.opinconsoleonly";
public static final String MISCELLANEOUS_OPINCONSOLEONLY = "miscellaneous.opinconsoleonly";
@Moved(newPath = COMPATIBILITY_MANAGELISTENERS)
public static final String MISCELLANEOUS_MANAGELISTENERS = "miscellaneous.managelisteners";
public static final String MISCELLANEOUS_MANAGELISTENERS = "miscellaneous.managelisteners";
@Moved(newPath = INVENTORY_OPEN_CHECK)
public static final String INVENTORY_ENSURECLOSE = "checks.inventory.ensureclose";
public static final String INVENTORY_ENSURECLOSE = "checks.inventory.ensureclose";
@Moved(newPath = LOGGING_EXTENDED_STATUS)
public static final String LOGGING_DEBUG = "logging.debug";
@Deprecated
public static final String MISCELLANEOUS_REPORTTOMETRICS = "miscellaneous.reporttometrics";
public static final String MISCELLANEOUS_REPORTTOMETRICS = "miscellaneous.reporttometrics";
@Deprecated
public static final String BLOCKBREAK_FASTBREAK_MOD_CREATIVE = "checks.blockbreak.fastbreak.intervalcreative";
@Deprecated

View File

@ -36,8 +36,8 @@ public class DefaultConfig extends ConfigFile {
// not set(ConfPaths.CONFIGVERSION_CREATED, -1);
// not set(ConfPaths.CONFIGVERSION_SAVED, -1);
set(ConfPaths.LOGGING_ACTIVE, true);
set(ConfPaths.LOGGING_DEBUG, false);
set(ConfPaths.LOGGING_MAXQUEUESIZE, 5000);
set(ConfPaths.LOGGING_EXTENDED_STATUS, false);
set(ConfPaths.LOGGING_BACKEND_CONSOLE_ACTIVE, true);
set(ConfPaths.LOGGING_BACKEND_CONSOLE_PREFIX, "[NoCheatPlus] ");
set(ConfPaths.LOGGING_BACKEND_CONSOLE_ASYNCHRONOUS, true);

View File

@ -558,7 +558,7 @@ public class NoCheatPlus extends JavaPlugin implements NoCheatPlusAPI {
@Override
public void onDisable() {
final boolean verbose = ConfigManager.getConfigFile().getBoolean(ConfPaths.LOGGING_DEBUG);
final boolean verbose = ConfigManager.getConfigFile().getBoolean(ConfPaths.LOGGING_EXTENDED_STATUS);
// Remove listener references.
if (verbose){
@ -616,7 +616,6 @@ public class NoCheatPlus extends JavaPlugin implements NoCheatPlusAPI {
try {
dl.onDisable();
} catch (Throwable t) {
// bad :)
logManager.severe(Streams.INIT, "DisableListener (" + dl.getClass().getName() + "): " + t.getClass().getSimpleName() + " / " + t.getMessage());
logManager.severe(Streams.INIT, t);
}
@ -624,8 +623,13 @@ public class NoCheatPlus extends JavaPlugin implements NoCheatPlusAPI {
// Write some debug/statistics.
final Counters counters = getGenericInstance(Counters.class);
if (verbose && counters != null) {
logManager.info(Streams.INIT, counters.getMergedCountsString(true));
if (counters != null) {
// Ensure we get this kind of information for the time being.
if (verbose) {
logManager.info(Streams.INIT, counters.getMergedCountsString(true)); // Server logger needs info level.
} else {
logManager.debug(Streams.TRACE_FILE, counters.getMergedCountsString(true));
}
}
// Hooks:
@ -1243,7 +1247,7 @@ public class NoCheatPlus extends JavaPlugin implements NoCheatPlusAPI {
}
// (The index might be bigger than size by now.)
final boolean debug = config.getBoolean(ConfPaths.LOGGING_DEBUG);
final boolean debug = config.getBoolean(ConfPaths.LOGGING_EXTENDED_STATUS);
// If not finished, schedule further checks.
if (consistencyCheckerIndex < consistencyCheckers.size()){
@ -1254,12 +1258,9 @@ public class NoCheatPlus extends JavaPlugin implements NoCheatPlusAPI {
}
});
if (debug){
logManager.info(Streams.TRACE_FILE, "[NoCheatPlus] Re-scheduled consistency-checks.");
logManager.info(Streams.TRACE_FILE, "[NoCheatPlus] Interrupted consistency checking until next tick.");
}
}
else if (debug){
logManager.info(Streams.TRACE_FILE, "[NoCheatPlus] Consistency-checks run.");
}
}
@Override