style(logging): 调整日志级别从错误到信息

- 将 QuotaMonitorService 中的空值检查日志从 Error 级别改为 Info 级别
- 将 SwapEodPositionService 中的参数验证日志从 Error 级别改为 Info 级别
- 保持原有的异常抛出逻辑不变,仅修改日志输出级别
- 统一参数验证相关的日志记录方式
This commit is contained in:
hjhan
2026-03-25 10:40:12 +08:00
parent 36419d8211
commit 99ffa9c2bb
2 changed files with 13 additions and 13 deletions
@@ -223,25 +223,25 @@ namespace YLErp.Modules.SwapModule
// 验证关键参数
if (td == null)
{
Log.Error("[DealInterests] 参数错误: td (trade) 为 null");
Log.Info("[DealInterests] 参数验证: td (trade) 为 null");
throw new ArgumentNullException(nameof(td), "交易对象不能为null");
}
if (interestList == null)
{
Log.Error($"[DealInterests] 参数错误: interestList 为 null, td.id: {td.id}");
Log.Info($"[DealInterests] 参数验证: interestList 为 null, td.id: {td.id}");
throw new ArgumentNullException(nameof(interestList), "利息腿列表不能为null");
}
if (flowEvents == null)
{
Log.Error($"[DealInterests] 参数错误: flowEvents 为 null, td.id: {td.id}");
Log.Info($"[DealInterests] 参数验证: flowEvents 为 null, td.id: {td.id}");
throw new ArgumentNullException(nameof(flowEvents), "流水事件列表不能为null");
}
if (autoInterests == null)
{
Log.Error($"[DealInterests] 参数错误: autoInterests 为 null, td.id: {td.id}");
Log.Info($"[DealInterests] 参数验证: autoInterests 为 null, td.id: {td.id}");
throw new ArgumentNullException(nameof(autoInterests), "自动互换列表不能为null");
}
var hasClose = flowEvents.Any(x => x.EventType == (int)SwapEventTypeEnum.);
@@ -715,25 +715,25 @@ namespace YLErp.Modules.SwapModule
// 详细的参数验证
if (td == null)
{
Log.Error("[SaveAutoEodInterestPosition] 参数错误: td (trade) 为 null");
Log.Info("[SaveAutoEodInterestPosition] 参数验证: td (trade) 为 null");
throw new ArgumentNullException(nameof(td), "交易对象不能为null");
}
if (position == null)
{
Log.Error($"[SaveAutoEodInterestPosition] 参数错误: position 为 null, td.id: {td.id}");
Log.Info($"[SaveAutoEodInterestPosition] 参数验证: position 为 null, td.id: {td.id}");
throw new ArgumentNullException(nameof(position), "持仓对象不能为null");
}
if (interval == null)
{
Log.Error($"[SaveAutoEodInterestPosition] 参数错误: interval 为 null, td.id: {td.id}, position.id: {position.id}");
Log.Info($"[SaveAutoEodInterestPosition] 参数验证: interval 为 null, td.id: {td.id}, position.id: {position.id}");
throw new ArgumentNullException(nameof(interval), "观察日信息不能为null");
}
if (td.trade_extend == null)
{
Log.Error($"[SaveAutoEodInterestPosition] 参数错误: td.trade_extend 为 null, td.id: {td.id}, td.TradeNumber: {td.TradeNumber}");
Log.Info($"[SaveAutoEodInterestPosition] 参数验证: td.trade_extend 为 null, td.id: {td.id}, td.TradeNumber: {td.TradeNumber}");
throw new ArgumentNullException("td.trade_extend", "交易扩展信息不能为null");
}
@@ -742,7 +742,7 @@ namespace YLErp.Modules.SwapModule
// 验证 ExtendObj
if (td.trade_extend.ExtendObj == null)
{
Log.Error($"[SaveAutoEodInterestPosition] 参数错误: td.trade_extend.ExtendObj 为 null, td.id: {td.id}");
Log.Info($"[SaveAutoEodInterestPosition] 参数验证: td.trade_extend.ExtendObj 为 null, td.id: {td.id}");
throw new ArgumentNullException("td.trade_extend.ExtendObj", "交易扩展对象不能为null");
}