From 29360feb4e6b678cb6a821c6a9de96f7049c9c0e Mon Sep 17 00:00:00 2001 From: Jeremy Wood Date: Mon, 23 Jan 2012 13:02:46 -0500 Subject: [PATCH] Fix potential bug in debug logging. Possibly fixes issue with debug logging not appearing in debug.log. --- .../com/onarandombox/MultiverseCore/utils/DebugLog.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/onarandombox/MultiverseCore/utils/DebugLog.java b/src/main/java/com/onarandombox/MultiverseCore/utils/DebugLog.java index 8cb9a53c..43ddd6a8 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/utils/DebugLog.java +++ b/src/main/java/com/onarandombox/MultiverseCore/utils/DebugLog.java @@ -11,6 +11,9 @@ import java.io.IOException; import java.io.PrintWriter; import java.io.StringWriter; import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; import java.util.logging.FileHandler; import java.util.logging.Formatter; import java.util.logging.Handler; @@ -38,7 +41,9 @@ public class DebugLog { try { this.fh = new FileHandler(file, true); this.log.setUseParentHandlers(false); - for (Handler handler : this.log.getHandlers()) { + List handlerList = new ArrayList(); + handlerList.addAll(Arrays.asList(this.log.getHandlers())); + for (Handler handler : handlerList) { this.log.removeHandler(handler); } this.log.addHandler(this.fh);