浏览代码

现有log输出,无法区分是哪个串口的。

sat23 3 年之前
父节点
当前提交
94f8bfbf8e
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. 5 1
      SCBC Factory Tools/LogHelper/Writelog.cs

+ 5 - 1
SCBC Factory Tools/LogHelper/Writelog.cs

@@ -61,7 +61,11 @@ namespace SXLibrary
 
                     Monitor.Enter(FileLock);
 
-                    string _path = FilePath + msg.Substring(0, 5).Trim() + "\\" + DateTime.Now.ToString("yyyy-MM");
+                    string _path;
+                    if ( msg.StartsWith("COM") )
+                        _path = FilePath + msg.Substring(0, 10).Trim() + "\\" + DateTime.Now.ToString("yyyy-MM");
+                    else
+                        _path = FilePath + msg.Substring(0, 5).Trim() + "\\" + DateTime.Now.ToString("yyyy-MM");
 
                     if (!Directory.Exists(_path))
                     {