A:增加日志输出

This commit is contained in:
jimmy committed 2025-05-30 20:44:10 +08:00
1 parent a6f32164f6
commit e2f0d78d97
6 files changed
+64 -44

No files matched your search

@@ -1,3 +1,5 @@
using Common.Logger;
namespace WinDivertNet.WinDivertWrapper;
using System;
@@ -56,7 +58,7 @@ public class WinDivertController : IDisposable
if (_handle == IntPtr.Zero)
{
int errorCode = Marshal.GetLastWin32Error();
Console.WriteLine($"WinDivert打开失败,错误码: {errorCode}");
Log.Information($"WinDivert打开失败,错误码: {errorCode}");
}
return IsValid;
@@ -102,7 +104,7 @@ public class WinDivertController : IDisposable
uint readLen = 0;
if (WinDivert.Recv(_handle, buffer, (uint)buffer.Length, ref addr, ref readLen))
{
Console.WriteLine($"Receive: {readLen}");
Log.Information($"Receive: {readLen}");
return readLen;
}