mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-11-23 19:16:40 +01:00
Fix [WorldGuard] in log messages stacking on reloads.
Fixes WORLDGUARD-3192.
This commit is contained in:
parent
df985013eb
commit
c7442c2a9e
@ -62,9 +62,12 @@ public void close() throws SecurityException {
|
||||
public static void register(Logger logger, String prefix) {
|
||||
checkNotNull(logger);
|
||||
|
||||
// Fix issues with multiple classloaders loading the same class
|
||||
String className = RecordMessagePrefixer.class.getCanonicalName();
|
||||
|
||||
logger.setUseParentHandlers(false);
|
||||
for (Handler handler : logger.getHandlers()) {
|
||||
if (handler instanceof RecordMessagePrefixer) {
|
||||
if (handler.getClass().getCanonicalName().equals(className)) {
|
||||
logger.removeHandler(handler);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user