[FIX] Slf4j detect fix

This commit is contained in:
Gravita 2021-04-29 22:50:31 +07:00
parent 9f05594915
commit 1b7e463ddb
2 changed files with 3 additions and 7 deletions

View file

@ -25,7 +25,6 @@ public class ClientLauncherWrapper {
public static int launcherMemoryLimit;
public static void main(String[] arguments) throws IOException, InterruptedException {
System.setProperty("launcher.noSlf4j", "true"); //TODO: Normal fix
LogHelper.printVersion("Launcher");
LogHelper.printLicense("Launcher");
JVMHelper.checkStackTrace(ClientLauncherWrapper.class);
@ -74,7 +73,6 @@ public static void main(String[] arguments) throws IOException, InterruptedExcep
context.jvmProperties.put(LogHelper.DEBUG_PROPERTY, Boolean.toString(LogHelper.isDebugEnabled()));
context.jvmProperties.put(LogHelper.STACKTRACE_PROPERTY, Boolean.toString(LogHelper.isStacktraceEnabled()));
context.jvmProperties.put(LogHelper.DEV_PROPERTY, Boolean.toString(LogHelper.isDevEnabled()));
context.jvmProperties.put("launcher.noSlf4j", "true"); //TODO: Normal fix
context.addSystemProperty(DirBridge.CUSTOMDIR_PROPERTY);
context.addSystemProperty(DirBridge.USE_CUSTOMDIR_PROPERTY);
context.addSystemProperty(DirBridge.USE_OPTDIR_PROPERTY);

View file

@ -9,10 +9,7 @@
import java.nio.file.Path;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Collections;
import java.util.Locale;
import java.util.Objects;
import java.util.Set;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.util.function.Consumer;
import java.util.function.Supplier;
@ -35,7 +32,8 @@ public final class LogHelper {
static {
boolean useSlf4j = false;
try {
Class.forName("org.slf4j.Logger");
Class.forName("org.slf4j.Logger", false, LogHelper.class.getClassLoader());
Class.forName("org.slf4j.impl.StaticLoggerBinder", false, LogHelper.class.getClassLoader());
useSlf4j = !Boolean.getBoolean(NO_SLF4J_PROPERTY);
} catch (ClassNotFoundException ignored) {
}