ref: 日志中附带线程 ID

This commit is contained in:
龙腾猫跃 committed 2026-06-14 01:11:15 +08:00
1 parent d3b657d725
commit 0b075c97c0
1 file changed
+1 -1
+1 -1
View File
@@ -220,7 +220,7 @@ public class BaseLogger {
.Join("\r\n");
}
public static string GetLogPrefix(LogLevel level, string filePath)
=> $"{DateTime.Now:HH':'mm':'ss'.'fff} {level.ToString().First()} {(Thread.CurrentThread.Name is null ? "" : $"<{Thread.CurrentThread.Name}> ")}[{PathUtils.GetLastPart(filePath).BeforeFirst(".")}] ";
=> $"{DateTime.Now:HH':'mm':'ss'.'fff} {level.ToString().First()} {(Thread.CurrentThread.Name is null ? "" : $"<{Thread.CurrentThread.ManagedThreadId} · {Thread.CurrentThread.Name}> ")}[{PathUtils.GetLastPart(filePath).BeforeFirst(".")}] ";
/// <summary>
/// 执行 <see cref="LogBehavior"/>。