Add more debug logging to Settings (#2140)

Adds debug logging for `getChatFormat` and `getCommandCooldownEntry`, which makes it much easier to track down issues with group formats in EssentialsX Chat and command cooldowns respectively.
This commit is contained in:
md678685 2018-08-25 18:09:08 +01:00 committed by GitHub
parent 935b5cfe0f
commit c79db98978
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -432,6 +432,9 @@ public class Settings implements net.ess3.api.ISettings {
mFormat = "§r".concat(mFormat);
chatFormats.put(group, mFormat);
}
if (isDebug()) {
ess.getLogger().info(String.format("Found format '%s' for group '%s'", mFormat, group));
}
return mFormat;
}
@ -1293,7 +1296,12 @@ public class Settings implements net.ess3.api.ISettings {
if (isCommandCooldownsEnabled()) {
for (Entry<Pattern, Long> entry : this.commandCooldowns.entrySet()) {
// Check if label matches current pattern (command-cooldown in config)
if (entry.getKey().matcher(label).matches()) {
boolean matches = entry.getKey().matcher(label).matches();
if (isDebug()) {
ess.getLogger().info(String.format("Checking command '%s' against cooldown '%s': %s", label, entry.getKey(), matches));
}
if (matches) {
return entry;
}
}