Skip to content

Commit 4b0a0ac

Browse files
committed
Fixed the broken debug logger
1 parent b12ee6f commit 4b0a0ac

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

src/main/java/me/despical/commandframework/CommandFramework.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ private void checkIsAlreadyInitialized() {
9090

9191
private void initializeLogger() {
9292
if (this.optionManager.isEnabled(FrameworkOption.DEBUG)) {
93-
this.logger = new DebugLogger();
93+
this.logger = new DebugLogger(plugin.getLogger());
9494
return;
9595
}
9696

src/main/java/me/despical/commandframework/debug/DebugLogger.java

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818

1919
package me.despical.commandframework.debug;
2020

21+
import java.util.logging.Level;
22+
import java.util.logging.LogRecord;
2123
import java.util.logging.Logger;
2224

2325
/**
@@ -27,7 +29,15 @@
2729
*/
2830
public class DebugLogger extends Logger {
2931

30-
public DebugLogger() {
31-
super("CF Debugger", null);
32-
}
32+
public DebugLogger(Logger parent) {
33+
super("CF Debug", null);
34+
this.setParent(parent);
35+
this.setLevel(Level.ALL);
36+
}
37+
38+
@Override
39+
public void log(LogRecord record) {
40+
record.setMessage("[CF Debug] " + record.getMessage());
41+
super.log(record);
42+
}
3343
}

0 commit comments

Comments
 (0)