From 7548c795ec26a13bf295f5bec4f3005e4476ade5 Mon Sep 17 00:00:00 2001
From: mrzhssss <pro6@qq.com>
Date: 星期日, 29 一月 2023 15:30:29 +0800
Subject: [PATCH] #

---
 src/main/java/com/zy/core/thread/MelsecCrnThread.java |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/main/java/com/zy/core/thread/MelsecCrnThread.java b/src/main/java/com/zy/core/thread/MelsecCrnThread.java
index 7ad1b69..b2a5fb2 100644
--- a/src/main/java/com/zy/core/thread/MelsecCrnThread.java
+++ b/src/main/java/com/zy/core/thread/MelsecCrnThread.java
@@ -234,6 +234,8 @@
      * 鍐欏叆鏁版嵁
      */
     private boolean write(CrnCommand command){
+        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
+
         if (null == command) {
             News.error("鍫嗗灈鏈哄啓鍏ュ懡浠や负绌�");
             return false;
@@ -330,12 +332,12 @@
         } catch (Exception ignore) {}
 
         if (result != null && result.IsSuccess) {
-            News.info("鍫嗗灈鏈哄懡浠や笅鍙慬id:{}] >>>>> {}", slave.getId(), JSON.toJSON(command));
+            News.info(methodName + ":鍫嗗灈鏈哄懡浠や笅鍙慬id:{}] >>>>> {}", slave.getId(), JSON.toJSON(command));
             OutputQueue.CRN.offer(MessageFormat.format("銆恵0}銆慬id:{1}] >>>>> 鍛戒护涓嬪彂锛� {2}", DateUtils.convert(new Date()), slave.getId(), JSON.toJSON(command)));
             return true;
         } else {
             OutputQueue.CRN.offer(MessageFormat.format("銆恵0}銆戝啓鍏ュ爢鍨涙満plc鏁版嵁澶辫触 ===>> [id:{1}] [ip:{2}] [port:{3}]", DateUtils.convert(new Date()), slave.getId(), slave.getIp(), slave.getPort()));
-            News.error("鍐欏叆鍫嗗灈鏈簆lc鏁版嵁澶辫触 ===>> [id:{}] [ip:{}] [port:{}]", slave.getId(), slave.getIp(), slave.getPort());
+            News.error(methodName + ":鍐欏叆鍫嗗灈鏈簆lc鏁版嵁澶辫触 ===>> [id:{}] [ip:{}] [port:{}]", slave.getId(), slave.getIp(), slave.getPort());
             return false;
         }
     }

--
Gitblit v1.9.1