Fixed ANSI support on Windows

This commit is contained in:
RaphiMC 2023-09-10 17:00:28 +02:00
parent 73f2e96201
commit 59e9aa708d
No known key found for this signature in database
GPG Key ID: 0F6BB0657A03AC94
2 changed files with 3 additions and 0 deletions

View File

@ -91,6 +91,7 @@ dependencies {
include "net.sf.jopt-simple:jopt-simple:5.0.4"
include "org.apache.logging.log4j:log4j-core:2.20.0"
include "org.apache.logging.log4j:log4j-slf4j-impl:2.20.0"
include "org.fusesource.jansi:jansi:2.4.0"
include("com.mojang:authlib:3.16.29") {
exclude group: "org.slf4j", module: "slf4j-api"
}

View File

@ -21,6 +21,7 @@ import com.mojang.authlib.GameProfile;
import com.viaversion.viaversion.api.connection.UserConnection;
import org.apache.logging.log4j.Level;
import org.apache.logging.log4j.LogManager;
import org.fusesource.jansi.AnsiConsole;
import java.io.PrintStream;
import java.net.InetSocketAddress;
@ -35,6 +36,7 @@ public class Logger {
public static final PrintStream SYSERR = System.err;
public static void setup() {
AnsiConsole.systemInstall();
System.setErr(new LoggerPrintStream("STDERR", SYSERR));
System.setOut(new LoggerPrintStream("STDOUT", SYSOUT));
}