25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 
 

28 satır
889 B

  1. using JT808.Gateway.Abstractions;
  2. using JT808.Gateway.Abstractions.Enums;
  3. using JT808.Protocol.Extensions;
  4. using Microsoft.Extensions.Logging;
  5. using System;
  6. using System.Collections.Generic;
  7. using System.Text;
  8. namespace JT808.Gateway.SimpleServer.Impl
  9. {
  10. public class JT808MsgLogging : IJT808MsgLogging
  11. {
  12. private readonly ILogger Logger;
  13. public JT808MsgLogging(ILoggerFactory loggerFactory)
  14. {
  15. Logger = loggerFactory.CreateLogger("JT808MsgLogging");
  16. }
  17. public void Processor((string TerminalNo, byte[] Data) parameter, JT808MsgLoggingType jT808MsgLoggingType)
  18. {
  19. var (number, data) = parameter;
  20. if (Logger.IsEnabled(LogLevel.Debug))
  21. {
  22. Logger.LogDebug("{type}-{number}-{data}",jT808MsgLoggingType,number,data?.ToHexString()??"no data.");
  23. }
  24. }
  25. }
  26. }