Browse Source

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

sat23 3 years ago
parent
commit
94f8bfbf8e
1 changed files with 5 additions and 1 deletions
  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))
                     {