Skip to content

Commit d97c528

Browse files
committed
[删除] 无效参数配置
1 parent 9522f72 commit d97c528

File tree

2 files changed

+0
-26
lines changed

2 files changed

+0
-26
lines changed

GameFrameX.StartUp/GameApp.cs

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -81,29 +81,6 @@ public static async Task Entry(string[] args, Action initAction, Action<LogOptio
8181
LogOptions.Default.FileSizeLimitBytes = launcherOptions.LogFileSizeLimitBytes;
8282
LogOptions.Default.LogEventLevel = launcherOptions.LogEventLevel;
8383
LogOptions.Default.RollingInterval = launcherOptions.LogRollingInterval;
84-
if (launcherOptions.LogGrafanaLokiLabels != null)
85-
{
86-
// 处理额外的自定义标签
87-
var lokiLabels = launcherOptions.LogGrafanaLokiLabels.ToList();
88-
var count = lokiLabels.Count;
89-
// 检查标签数量是否成对
90-
if (count % 2 != 0)
91-
{
92-
LogHelper.WarningConsole("Grafana Loki 标签数量不是成对的,将忽略最后一个标签");
93-
count--;
94-
}
95-
96-
for (int i = 0; i < count; i += 2)
97-
{
98-
var lokiLabelKey = lokiLabels[i];
99-
var lokiLabelValue = lokiLabels[i + 1];
100-
// 检查key是否已存在
101-
if (!LogOptions.Default.GrafanaLokiLabels.TryAdd(lokiLabelKey, lokiLabelValue))
102-
{
103-
LogHelper.WarningConsole($"Grafana Loki 标签 {lokiLabelKey} 已存在,将被忽略");
104-
}
105-
}
106-
}
10784
}
10885

10986
logConfiguration?.Invoke(LogOptions.Default);

GameFrameX.StartUp/Options/LauncherOptions.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,6 @@ public sealed class LauncherOptions
130130
[DefaultValue("http://localhost:3100")]
131131
public string LogGrafanaLokiUrl { get; set; } = "http://localhost:3100";
132132

133-
/// <summary>GrafanaLoki 标签</summary>
134-
public IEnumerable<string> LogGrafanaLokiLabels { get; set; } = new List<string>();
135-
136133
/// <summary>GrafanaLoki 用户名或Email</summary>
137134
[Option(nameof(LogGrafanaLokiUsername), Description = "GrafanaLoki 用户名或Email,当LogIsGrafanaLoki为true时生效。")]
138135
public string LogGrafanaLokiUsername { get; set; }

0 commit comments

Comments
 (0)