diff --git a/common/src/main/java/org/embeddedt/modernfix/core/config/ModernFixEarlyConfig.java b/common/src/main/java/org/embeddedt/modernfix/core/config/ModernFixEarlyConfig.java index c92f0907..b488e4c0 100644 --- a/common/src/main/java/org/embeddedt/modernfix/core/config/ModernFixEarlyConfig.java +++ b/common/src/main/java/org/embeddedt/modernfix/core/config/ModernFixEarlyConfig.java @@ -182,6 +182,7 @@ public class ModernFixEarlyConfig { .put("mixin.feature.snapshot_easter_egg", true) .put("mixin.feature.warn_missing_perf_mods", true) .put("mixin.feature.spark_profile_launch", false) + .put("mixin.feature.log_stdout_in_log_files", true) .put("mixin.devenv", isDevEnv) .put("mixin.perf.remove_spawn_chunks", isDevEnv) .putConditionally(() -> !isFabric, "mixin.bugfix.fix_config_crashes", true) diff --git a/forge/src/main/java/org/embeddedt/modernfix/platform/forge/ModernFixPlatformHooksImpl.java b/forge/src/main/java/org/embeddedt/modernfix/platform/forge/ModernFixPlatformHooksImpl.java index bfef2132..dbf8edf9 100644 --- a/forge/src/main/java/org/embeddedt/modernfix/platform/forge/ModernFixPlatformHooksImpl.java +++ b/forge/src/main/java/org/embeddedt/modernfix/platform/forge/ModernFixPlatformHooksImpl.java @@ -17,6 +17,7 @@ import net.minecraftforge.fml.ModLoader; import net.minecraftforge.fml.loading.FMLLoader; import net.minecraftforge.fml.loading.FMLPaths; import net.minecraftforge.fml.loading.LoadingModList; +import net.minecraftforge.fml.loading.TracingPrintStream; import net.minecraftforge.fml.loading.moddiscovery.ModInfo; import net.minecraftforge.network.PacketDistributor; import net.minecraftforge.server.ServerLifecycleHooks; @@ -33,6 +34,7 @@ import org.embeddedt.modernfix.spark.SparkLaunchProfiler; import org.embeddedt.modernfix.util.CommonModUtil; import org.embeddedt.modernfix.util.DummyList; import org.objectweb.asm.tree.ClassNode; +import org.slf4j.LoggerFactory; import org.spongepowered.asm.mixin.injection.struct.InjectorGroupInfo; import java.lang.reflect.Field; @@ -112,6 +114,11 @@ public class ModernFixPlatformHooksImpl implements ModernFixPlatformHooks { CommonModUtil.runWithoutCrash(() -> SparkLaunchProfiler.start("launch"), "Failed to start profiler"); } + if(ModernFixMixinPlugin.instance.isOptionEnabled("feature.log_stdout_in_log_files.PrintStreamReplacement")) { + System.setOut(new TracingPrintStream(LoggerFactory.getLogger("STDOUT"), System.out)); + System.setErr(new TracingPrintStream(LoggerFactory.getLogger("STDERR"), System.err)); + } + NightConfigFixer.monitorFileWatcher(); NightConfigWatchThrottler.throttle(); }