Skip to content

Commit 9a7e5a2

Browse files
committed
fix(Setting): 添加路径空值检查并优化日志输出
当路径为空时直接返回,避免不必要的文件检查 使用 LogHelper 替代直接控制台输出,提供更规范的日志记录 #49
1 parent cc3fb69 commit 9a7e5a2

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

GameFrameX.Utility/Setting/GlobalSettings.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,15 @@ public static class GlobalSettings
7474
public static void Load(string path)
7575
{
7676
Settings.Clear();
77+
if (path.IsNullOrEmptyOrWhiteSpace())
78+
{
79+
return;
80+
}
7781

7882
if (!File.Exists(path))
7983
{
80-
Console.BackgroundColor = ConsoleColor.Yellow;
81-
Console.Write("The profile does not exist. may cause startup failure==>>>" + path);
82-
Console.ResetColor();
83-
Console.WriteLine();
84+
var fullPath = Path.GetFullPath(path);
85+
LogHelper.ShowOption("Load Global Settings", fullPath);
8486
return;
8587
}
8688

0 commit comments

Comments
 (0)