From 627371d0ffdf50239313f2c86d022a0c5c69550d Mon Sep 17 00:00:00 2001
From: wanshenmean <cathay_xy@163.com>
Date: 星期二, 21 四月 2026 19:43:46 +0800
Subject: [PATCH] refactor(logging): 重构日志记录模块,统一使用Serilog和QuartzLogHelper
---
Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/RobotJob/RobotStateManager.cs | 11 ++++-------
1 files changed, 4 insertions(+), 7 deletions(-)
diff --git a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/RobotJob/RobotStateManager.cs b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/RobotJob/RobotStateManager.cs
index 4aaae62..5c1ecba 100644
--- a/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/RobotJob/RobotStateManager.cs
+++ b/Code/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/RobotJob/RobotStateManager.cs
@@ -1,6 +1,5 @@
-using Microsoft.Extensions.Logging;
using Newtonsoft.Json;
-using WIDESEAWCS_Core.LogHelper;
+using Serilog;
using WIDESEAWCS_ITaskInfoRepository;
using WIDESEAWCS_Model.Models;
@@ -94,8 +93,7 @@
if (currentEntity == null)
{
_repository.GetOrCreate(newState.IPAddress, newState.RobotCrane ?? new RobotCraneDevice());
- _logger.LogDebug("TryUpdateStateSafely锛氬垱寤烘柊鐘舵�侊紝IP: {IpAddress}", ipAddress);
- QuartzLogger.Debug($"鍒涘缓鏂扮姸鎬侊紝IP: {ipAddress}", ipAddress);
+ QuartzLogHelper.LogDebug(_logger, $"鍒涘缓鏂扮姸鎬侊紝IP: {ipAddress}", ipAddress);
return true;
}
@@ -112,8 +110,7 @@
if (!success)
{
- _logger.LogWarning("TryUpdateStateSafely锛氱増鏈啿绐侊紝鏇存柊澶辫触锛孖P: {IpAddress}锛屾湡鏈涚増鏈�: {ExpectedVersion}", ipAddress, expectedVersion);
- QuartzLogger.Warn($"鐗堟湰鍐茬獊锛屾洿鏂板け璐ワ紝IP: {ipAddress}", ipAddress);
+ QuartzLogHelper.LogWarn(_logger, $"TryUpdateStateSafely锛氱増鏈啿绐侊紝鏇存柊澶辫触锛孖P: {ipAddress}锛屾湡鏈涚増鏈�: {expectedVersion}", ipAddress);
}
return success;
@@ -161,4 +158,4 @@
return _repository.ToSocketState(entity);
}
}
-}
+}
\ No newline at end of file
--
Gitblit v1.9.3