Skip to content

Commit 31fd95f

Browse files
committed
Fixed dev mode logging issue.
1 parent c4bba0e commit 31fd95f

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

loader/src/main/java/com/fox2code/foxloader/launcher/FoxLauncher.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -295,8 +295,7 @@ public static void notifyJAnsiInstalled() {
295295
}
296296

297297
public static boolean wantJAnsi() {
298-
return hasLogger && LoggerHelper.consoleSupportColor &&
299-
(LoggerHelper.devEnvironment || !isClient());
298+
return hasLogger && LoggerHelper.wantJAnsi;
300299
}
301300

302301
public static boolean hasAnsi() {

loader/src/main/java/com/fox2code/foxloader/launcher/LoggerHelper.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,19 @@ final class LoggerHelper {
3737
private static final String formatDefault = "[%1$tT] [%2$-7s] %3$s";
3838
private static final String formatClient = "[%1$tT] [CLIENT] [%2$-7s] %3$s";
3939
private static final String formatServer = "[%1$tT] [SERVER] [%2$-7s] %3$s";
40+
private static final boolean hasConsoleObject = System.console() != null;
4041
static final boolean devEnvironment = FoxLauncher.DEVELOPING_FOXLOADER || FoxLauncher.DEV_MODE;
4142
static final boolean consoleSupportColor = devEnvironment ||
42-
Boolean.getBoolean("foxloader.console-support-color") || System.console() != null;
43+
Boolean.getBoolean("foxloader.console-support-color") || hasConsoleObject;
4344
private static final boolean disableLoggerHelper =
4445
Boolean.getBoolean("foxloader.disable-logger-helper");
4546
private static final boolean loggerDistinguishSide =
4647
Boolean.getBoolean("foxloader.logger-distinguish-side");
48+
static final boolean wantJAnsi = (consoleSupportColor && hasConsoleObject &&
49+
(!disableLoggerHelper) && (!devEnvironment) &&
50+
// Always allow the JVM Flags to work
51+
!Boolean.getBoolean("foxloader.force-ignore-jansi")) ||
52+
Boolean.getBoolean("foxloader.force-use-jansi");
4753
private static final String format = loggerDistinguishSide ?
4854
FoxLauncher.isServer() ? formatServer : formatClient : formatDefault;
4955
private static final FoxLoaderLogFormatter simpleFormatter = new FoxLoaderLogFormatter();

0 commit comments

Comments
 (0)