Browse Source

调整日志输出内容

develop
H Vs 9 months ago
parent
commit
7a663a5d1f
2 changed files with 5 additions and 4 deletions
  1. +2
    -2
      NearCardAttendance.Service/TcpServer/Handler/ProtocolHandler.cs
  2. +3
    -2
      NearCardAttendance.Service/TcpServer/Handler/RegisterHandler.cs

+ 2
- 2
NearCardAttendance.Service/TcpServer/Handler/ProtocolHandler.cs View File

@@ -58,10 +58,10 @@ namespace NearCardAttendance.Service.TcpServer.Handler
//var parser = buffer.ToString(Encoding.ASCII); //var parser = buffer.ToString(Encoding.ASCII);
ProtocolParser parser = new(buffer.ToString(Encoding.ASCII)); ProtocolParser parser = new(buffer.ToString(Encoding.ASCII));
context.FireChannelRead(parser); context.FireChannelRead(parser);
Console.WriteLine($"发送正常:{parser}");
//Console.WriteLine($"发送正常:{parser}");
//ProtocolWrapper wrapper = new ProtocolWrapper("82", parser.SeqNo, DateTime.Now.ToString("yyyyMMddHHmmss")); //ProtocolWrapper wrapper = new ProtocolWrapper("82", parser.SeqNo, DateTime.Now.ToString("yyyyMMddHHmmss"));
//Console.WriteLine(wrapper.GenerateProtocolString()); //Console.WriteLine(wrapper.GenerateProtocolString());
Console.WriteLine($"length:{parser.MessageLength},func_no:{parser.FuncNo},seq_no:{parser.SeqNo},data:{parser.Data}");
//Console.WriteLine($"length:{parser.MessageLength},func_no:{parser.FuncNo},seq_no:{parser.SeqNo},data:{parser.Data}");
ReleaseBuffer(); ReleaseBuffer();
} }
else if (buffer.ToString(Encoding.ASCII).Length > messageLength) else if (buffer.ToString(Encoding.ASCII).Length > messageLength)


+ 3
- 2
NearCardAttendance.Service/TcpServer/Handler/RegisterHandler.cs View File

@@ -4,6 +4,7 @@ using Microsoft.Extensions.Logging;
using NearCardAttendance.Common.helper; using NearCardAttendance.Common.helper;
using NearCardAttendance.Service.TcpServer.Mapper; using NearCardAttendance.Service.TcpServer.Mapper;
using NearCardAttendance.Service.TcpServer.Protocol; using NearCardAttendance.Service.TcpServer.Protocol;
using Newtonsoft.Json;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
@@ -235,7 +236,7 @@ namespace NearCardAttendance.Service.TcpServer.Handler
imei = deviceId imei = deviceId
}; };
var res=await _httpHelper.HttpToPostAsync(url, data); var res=await _httpHelper.HttpToPostAsync(url, data);
_logger.LogInformation($"{nameof(HandleSignRecsAsync)} 推送结果,{res}");
_logger.LogInformation($"{nameof(HandleSignRecsAsync)} 推送 {JsonConvert.SerializeObject(data)} 结果,{res}");
} }
/// <summary> /// <summary>
@@ -265,7 +266,7 @@ namespace NearCardAttendance.Service.TcpServer.Handler
imei = deviceId imei = deviceId
}; };
var res = await _httpHelper.HttpToPostAsync(url, data); var res = await _httpHelper.HttpToPostAsync(url, data);
_logger.LogInformation($"{nameof(HandleStdtSchoolRecsAsync)} 推送结果,{res}");
_logger.LogInformation($"{nameof(HandleStdtSchoolRecsAsync)} 推送 {JsonConvert.SerializeObject(data)} 结果,{res}");
} }
} }
} }

Loading…
Cancel
Save