增加日志组件

This commit is contained in:
2026-01-15 18:56:39 +08:00
parent 801ffb25fd
commit 2754cdff15
13 changed files with 1153 additions and 142 deletions

View File

@@ -1,4 +1,7 @@
namespace SHH.CameraSdk;
using Ayay.SerilogLogs;
using Serilog;
namespace SHH.CameraSdk;
/// <summary>
/// [驱动支持层] 海康 SDK 全局资源管理器 (V3.3.1 修复版)
@@ -103,7 +106,8 @@ public static class HikSdkManager
// 已预热过则直接返回,避免重复执行
if (_isWarmedUp) return;
Console.WriteLine($"[{DateTime.Now:HH:mm:ss.fff}] 正在进行播放库硬件探测预热,请稍候...");
Log.ForContext("SourceContext", LogModules.Core)
.Debug($"正在进行播放库硬件探测预热,请稍候...");
Stopwatch sw = Stopwatch.StartNew();
int tempPort = -1;
@@ -118,7 +122,8 @@ public static class HikSdkManager
sw.Stop();
_isWarmedUp = true;
Console.WriteLine($"[{DateTime.Now:HH:mm:ss.fff}] 预热完成!耗时: {sw.ElapsedMilliseconds}ms。后续调用将恢复正常。");
Log.ForContext("SourceContext", LogModules.Core)
.Debug($"预热完成!耗时: {sw.ElapsedMilliseconds}ms.");
}
#endregion