规范并补充日志内容
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
using OpenCvSharp;
|
||||
using Ayay.SerilogLogs;
|
||||
using OpenCvSharp;
|
||||
using Serilog;
|
||||
|
||||
namespace SHH.CameraSdk;
|
||||
|
||||
@@ -13,6 +15,8 @@ public class FrameConsumer : IDisposable
|
||||
{
|
||||
#region --- 私有资源与状态 (Private Resources & States) ---
|
||||
|
||||
private static ILogger _sysLog = Log.ForContext("SourceContext", LogModules.Core);
|
||||
|
||||
/// <summary> 帧缓冲队列(容量1):仅存储最新一帧,保证零延迟渲染 </summary>
|
||||
/// <remarks> BlockingCollection 封装线程安全操作,GetConsumingEnumerable 支持取消令牌 </remarks>
|
||||
private readonly BlockingCollection<SmartFrame> _frameBuffer = new(1);
|
||||
@@ -49,7 +53,7 @@ public class FrameConsumer : IDisposable
|
||||
|
||||
// 启动长期运行的渲染任务,提升线程调度优先级
|
||||
_renderTask = Task.Factory.StartNew(RenderLoop, TaskCreationOptions.LongRunning);
|
||||
Console.WriteLine($"[Consumer] 渲染线程启动成功,窗口名称: {_windowName}");
|
||||
_sysLog.Information($"[Consumer] 渲染线程启动成功,窗口名称: {_windowName}");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -75,7 +79,7 @@ public class FrameConsumer : IDisposable
|
||||
residualFrame.Dispose();
|
||||
}
|
||||
|
||||
Console.WriteLine($"[Consumer] 渲染线程已停止,窗口: {_windowName}");
|
||||
_sysLog.Information($"[Consumer] 渲染线程已停止,窗口: {_windowName}");
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
Reference in New Issue
Block a user