瀏覽代碼

增加错误日志打印

yinyujing 4 年之前
父節點
當前提交
9d458dca53

+ 8 - 6
NB_IOT_TCP_HP_SOCKET/DeviceControlForm.cs

@@ -59,7 +59,7 @@ namespace NB_IOT_TCP_HP_SOCKET
             }
             catch (Exception exception)
             {
-                LogUtil.WriteLog(exception.Message + "\r\n" + exception.StackTrace);
+                LogUtil.WriteLog(exception.Message + ">>>>" + exception.StackTrace);
             }
         }
 
@@ -208,7 +208,7 @@ namespace NB_IOT_TCP_HP_SOCKET
             }
             catch (Exception exception)
             {
-                LogUtil.WriteLog(exception.Message + "\r\n" + exception.StackTrace);
+                LogUtil.WriteLog(exception.Message + ">>>>" + exception.StackTrace);
             }
         }
 
@@ -384,8 +384,9 @@ namespace NB_IOT_TCP_HP_SOCKET
                 {
                     MessageBox.Show(this, message, caption, MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                 }
-                catch
+                catch(Exception ex)
                 {
+                    LogUtil.WriteLog(ex.Message + ">>>>" + ex.StackTrace);
                 }
             }
         }
@@ -421,9 +422,9 @@ namespace NB_IOT_TCP_HP_SOCKET
                     //rtxt_ResultMessage.AppendText("\r\n" + item.Name + ":" + item.Value);
                         
                 }
-                catch (Exception exception)
+                catch (Exception ex)
                 {
-                        
+                    LogUtil.WriteLog(ex.Message + ">>>>" + ex.StackTrace);
                 }
             }
             logQueue.Enqueue(rs.ToString());
@@ -536,8 +537,9 @@ namespace NB_IOT_TCP_HP_SOCKET
                         return ;
                     }
                 }
-                catch (Exception exception)
+                catch (Exception ex)
                 {
+                    LogUtil.WriteLog(ex.Message + ">>>>" + ex.StackTrace);
                     return;
                 }
                 

+ 3 - 1
NB_IOT_TCP_HP_SOCKET/MainForm_TCP.cs

@@ -482,7 +482,7 @@ namespace NB_IOT_TCP_HP_SOCKET
             }
             catch (Exception ex)
             {
-                LogUtil.WriteLog(ex.Message + ">>>" + ex.StackTrace);
+                AddMsg(ex.Message + ">>>" + ex.StackTrace, lbErrorData);
             }
 
             return HandleResult.Ok;
@@ -1146,6 +1146,7 @@ namespace NB_IOT_TCP_HP_SOCKET
                                                 }
                                                 catch (Exception ex)
                                                 {
+                                                    AddMsg(ex.Message + ">>>" + ex.StackTrace, lbErrorData);
                                                 }
 
                                             }
@@ -1288,6 +1289,7 @@ namespace NB_IOT_TCP_HP_SOCKET
                 }
                 catch (Exception ex)
                 {
+                    AddMsg(ex.Message + ">>>" + ex.StackTrace, lbErrorData);
                 }
             }
         }

+ 4 - 2
NB_IOT_TCP_HP_SOCKET/ParamSetForm.cs

@@ -1,4 +1,5 @@
-using System;
+using NB_IOT_TCP_HP_SOCKET.WWKJUtil;
+using System;
 using System.Collections.Generic;
 using System.ComponentModel;
 using System.Configuration;
@@ -155,8 +156,9 @@ namespace NB_IOT_TCP_HP_SOCKET
                 {
                     MessageBox.Show(this, message, caption, MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                 }
-                catch
+                catch(Exception ex)
                 {
+                    LogUtil.WriteLog(ex.Message + ">>>>" + ex.StackTrace);
                 }
             }
         }