diff --git a/SlnMesnac.RfidUpload.NLog/LogHelper.cs b/SlnMesnac.RfidUpload.NLog/LogHelper.cs index 2d7e7d6..f3a126c 100644 --- a/SlnMesnac.RfidUpload.NLog/LogHelper.cs +++ b/SlnMesnac.RfidUpload.NLog/LogHelper.cs @@ -35,13 +35,8 @@ namespace SlnMesnac.RfidUpload.NLog private static readonly Lazy _lazy = new Lazy(() => new LogHelper()); - public static LogHelper Instance - { - get - { - return _lazy.Value; - } - } + public static LogHelper Instance => _lazy.Value; + private LogHelper() { var logRepository = LogManager.GetRepository(Assembly.GetEntryAssembly()); @@ -69,7 +64,7 @@ namespace SlnMesnac.RfidUpload.NLog /// /// /// - public void Error(string info, Exception ex = null) + public void Error(string info, Exception? ex = null) { if (!string.IsNullOrEmpty(info) && ex == null) { diff --git a/SlnMesnac.RfidUpload.TouchSocket/WebApiClientApp.cs b/SlnMesnac.RfidUpload.TouchSocket/WebApiClientApp.cs index 529d816..2f29c04 100644 --- a/SlnMesnac.RfidUpload.TouchSocket/WebApiClientApp.cs +++ b/SlnMesnac.RfidUpload.TouchSocket/WebApiClientApp.cs @@ -87,13 +87,15 @@ namespace SlnMesnac.RfidUpload.TouchSocket containerRegisterQuery = paramStr }; var str = jsonChange.ModeToJson(container); - - logger.Info($"apIName:{apiName}:paramName:{paramName}:paramStr:{paramStr}"); + logger.Info("------------------------------http开始-----------------------------------------"); + logger.Info($"apIName:{apiName}"); + logger.Info($"paramName:{paramName}"); + logger.Info($"paramStr:{paramStr}"); logger.Info($"请求CSB接口调用服务,参数:{str}"); result = Post(appConfig.localUrl, container); logger.Info($"CSB接口返回信息:{result}"); - logger.Info("-----------------------------------------------------------------------"); + logger.Info("------------------------------http结束-----------------------------------------"); } catch (Exception e) { @@ -110,12 +112,13 @@ namespace SlnMesnac.RfidUpload.TouchSocket string result = string.Empty; try { + logger.Info("------------------------------http开始-----------------------------------------"); logger.Info($"apIName: paramName:"); logger.Info($"请求CSB接口调用服务,参数:{paramStr}"); result = Post(appConfig.localUrl, paramStr); logger.Info($"CSB接口返回信息:{result}"); - logger.Info("-----------------------------------------------------------------------"); + logger.Info("------------------------------http结束-----------------------------------------"); } catch (Exception e) { diff --git a/SlnMesnac.RfidUpload.UI/viewModel/MainWindowViewModel.cs b/SlnMesnac.RfidUpload.UI/viewModel/MainWindowViewModel.cs index 657bfff..0843b15 100644 --- a/SlnMesnac.RfidUpload.UI/viewModel/MainWindowViewModel.cs +++ b/SlnMesnac.RfidUpload.UI/viewModel/MainWindowViewModel.cs @@ -280,10 +280,7 @@ namespace SlnMesnac.RfidUpload.UI.viewModel //}; //加载标签信息 - _business.InstructionInfoDataGridEvent += info => - { - RefreshLabelInfoDataGrid(info); - }; + _business.InstructionInfoDataGridEvent += RefreshLabelInfoDataGrid; //加载解析日志 _business.RefreshLogMessageEvent += message =>