From c79db98978fd9d2a0d16650c8d9735dab30fd68e Mon Sep 17 00:00:00 2001 From: md678685 Date: Sat, 25 Aug 2018 18:09:08 +0100 Subject: [PATCH] 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. --- Essentials/src/com/earth2me/essentials/Settings.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Essentials/src/com/earth2me/essentials/Settings.java b/Essentials/src/com/earth2me/essentials/Settings.java index cb1dbe2f4..e182fe04a 100644 --- a/Essentials/src/com/earth2me/essentials/Settings.java +++ b/Essentials/src/com/earth2me/essentials/Settings.java @@ -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 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; } }