Skip to content
This repository was archived by the owner on Jan 25, 2026. It is now read-only.

Commit fcf7b5e

Browse files
authored
feat: 支持使用调试级别 log4j2 配置文件 (#179)
1 parent 85f18b8 commit fcf7b5e

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

App/Config.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ public static partial class Config
3131
/// </summary>
3232
[ConfigItem<bool>("HintRenderer", false)] public partial bool Renderer { get; set; }
3333

34+
/// <summary>
35+
/// 使用调试级别 Log4j2 配置提示。
36+
/// </summary>
37+
[ConfigItem<bool>("HintDebugLog4j2Config", false)] public partial bool DebugLog4j2Config { get; set; }
38+
3439
// [ConfigItem<int>("HintDownload", 0)] public partial int Download { get; set; }
3540

3641
/// <summary>
@@ -883,6 +888,7 @@ partial class HideConfigGroup
883888
[ConfigItem<bool>("VersionAdvanceDisableJLW", false, ConfigSource.GameInstance)] public partial ArgConfig<bool> DisableJlw { get; }
884889
[ConfigItem<bool>("VersionAdvanceUseProxyV2", false, ConfigSource.GameInstance)] public partial ArgConfig<bool> UseProxy { get; }
885890
[ConfigItem<bool>("VersionAdvanceDisableRW", false, ConfigSource.GameInstance)] public partial ArgConfig<bool> DisableRw { get; }
891+
[ConfigItem<bool>("VersionUseDebugLog4j2Config", false, ConfigSource.GameInstance)] public partial ArgConfig<bool> UseDebugLof4j2Config { get; }
886892
[ConfigItem<int>("VersionRamType", 2, ConfigSource.GameInstance)] public partial ArgConfig<int> MemorySolution { get; }
887893
[ConfigItem<int>("VersionRamCustom", 15, ConfigSource.GameInstance)] public partial ArgConfig<int> CustomMemorySize { get; }
888894
[ConfigItem<int>("VersionRamOptimize", 0, ConfigSource.GameInstance)] public partial ArgConfig<int> OptimizeMemoryResolution { get; }

Minecraft/Launch/Utils/LaunchEnvUtils.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,18 @@ namespace PCL.Core.Minecraft.Launch.Utils;
1010

1111
public static class LaunchEnvUtils {
1212
private const string JavaWrapperResource = "Resources/java-wrapper.jar";
13+
private const string DebugLegacyLog4j2ConfigResource = "Resources/log4j2-legacy-debug.xml";
14+
private const string DebugLog4j2ConfigResource = "Resources/log4j2-debug.xml";
1315
private const string LinkDResource = "Resources/linkd.exe";
1416

1517
private static readonly object ExtractJavaWrapperLock = new();
18+
private static readonly object ExtractLegacyDebugLog4j2ConfigLock = new();
19+
private static readonly object ExtractDebugLog4j2ConfigLock = new();
1620
private static readonly object ExtractLinkDLock = new();
1721

1822
public static string ExtractJavaWrapper() => ExtractFile(JavaWrapperResource, "JavaWrapper.jar", ExtractJavaWrapperLock);
23+
public static string ExtractLegacyDebugLog4j2Config() => ExtractFile(DebugLegacyLog4j2ConfigResource, "log4j2-legacy-debug.xml", ExtractLegacyDebugLog4j2ConfigLock);
24+
public static string ExtractDebugLog4j2Config() => ExtractFile(DebugLog4j2ConfigResource, "log4j2-debug.xml", ExtractDebugLog4j2ConfigLock);
1925
public static string ExtractLinkD() => ExtractFile(LinkDResource, "linkd.exe", ExtractLinkDLock);
2026

2127
private static string ExtractFile(string resourceName, string fileName, object lockObj) {

0 commit comments

Comments
 (0)