mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-07-23 22:14:09 +00:00
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:
parent
935b5cfe0f
commit
c79db98978
1 changed files with 9 additions and 1 deletions
|
@ -432,6 +432,9 @@ public class Settings implements net.ess3.api.ISettings {
|
||||||
mFormat = "§r".concat(mFormat);
|
mFormat = "§r".concat(mFormat);
|
||||||
chatFormats.put(group, mFormat);
|
chatFormats.put(group, mFormat);
|
||||||
}
|
}
|
||||||
|
if (isDebug()) {
|
||||||
|
ess.getLogger().info(String.format("Found format '%s' for group '%s'", mFormat, group));
|
||||||
|
}
|
||||||
return mFormat;
|
return mFormat;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1293,7 +1296,12 @@ public class Settings implements net.ess3.api.ISettings {
|
||||||
if (isCommandCooldownsEnabled()) {
|
if (isCommandCooldownsEnabled()) {
|
||||||
for (Entry<Pattern, Long> entry : this.commandCooldowns.entrySet()) {
|
for (Entry<Pattern, Long> entry : this.commandCooldowns.entrySet()) {
|
||||||
// Check if label matches current pattern (command-cooldown in config)
|
// 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;
|
return entry;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue