mirror of
https://github.com/Multiverse/Multiverse-Core.git
synced 2024-11-22 10:36:06 +01:00
Fix potential bug in debug logging. Possibly fixes issue with debug logging not appearing in debug.log.
This commit is contained in:
parent
c7d35f13f4
commit
29360feb4e
@ -11,6 +11,9 @@ import java.io.IOException;
|
|||||||
import java.io.PrintWriter;
|
import java.io.PrintWriter;
|
||||||
import java.io.StringWriter;
|
import java.io.StringWriter;
|
||||||
import java.text.SimpleDateFormat;
|
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.FileHandler;
|
||||||
import java.util.logging.Formatter;
|
import java.util.logging.Formatter;
|
||||||
import java.util.logging.Handler;
|
import java.util.logging.Handler;
|
||||||
@ -38,7 +41,9 @@ public class DebugLog {
|
|||||||
try {
|
try {
|
||||||
this.fh = new FileHandler(file, true);
|
this.fh = new FileHandler(file, true);
|
||||||
this.log.setUseParentHandlers(false);
|
this.log.setUseParentHandlers(false);
|
||||||
for (Handler handler : this.log.getHandlers()) {
|
List<Handler> handlerList = new ArrayList<Handler>();
|
||||||
|
handlerList.addAll(Arrays.asList(this.log.getHandlers()));
|
||||||
|
for (Handler handler : handlerList) {
|
||||||
this.log.removeHandler(handler);
|
this.log.removeHandler(handler);
|
||||||
}
|
}
|
||||||
this.log.addHandler(this.fh);
|
this.log.addHandler(this.fh);
|
||||||
|
Loading…
Reference in New Issue
Block a user