mirror of
https://github.com/ViaVersion/ViaProxy.git
synced 2024-11-30 03:15:56 -05:00
Fixed jANSI segfaulting the JVM when there is no console
This commit is contained in:
parent
59e9aa708d
commit
8baa02ec40
1 changed files with 3 additions and 1 deletions
|
@ -36,7 +36,9 @@ public class Logger {
|
||||||
public static final PrintStream SYSERR = System.err;
|
public static final PrintStream SYSERR = System.err;
|
||||||
|
|
||||||
public static void setup() {
|
public static void setup() {
|
||||||
|
if (System.console() != null) { // jANSI is the best lib. If there is no console it just segfaults the JVM process. Thanks!
|
||||||
AnsiConsole.systemInstall();
|
AnsiConsole.systemInstall();
|
||||||
|
}
|
||||||
System.setErr(new LoggerPrintStream("STDERR", SYSERR));
|
System.setErr(new LoggerPrintStream("STDERR", SYSERR));
|
||||||
System.setOut(new LoggerPrintStream("STDOUT", SYSOUT));
|
System.setOut(new LoggerPrintStream("STDOUT", SYSOUT));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue