Explorar el Código

mxg:取消log文件

mengxiangge hace 5 años
padre
commit
0716decd39
Se han modificado 2 ficheros con 0 adiciones y 10 borrados
  1. 0 7
      Starter/StartVisionSelector/Program.cs
  2. 0 3
      Starter/Starter/Program.cs

+ 0 - 7
Starter/StartVisionSelector/Program.cs

@@ -55,12 +55,10 @@ namespace StartVisionSelector
             
             //保存版本号
             var runPath = AppDomain.CurrentDomain.BaseDirectory;
-            File.AppendAllText(@"D:\log.txt", path + "\r\n");
             string revitVision = null;
             try
             {
                 revitVision = RevitVisionUtil.GetRevitVision(path);
-                File.AppendAllText(@"D:\log.txt", revitVision + "\r\n");
                 if (string.IsNullOrEmpty(revitVision))
                 {
                     SaveFileErrorResult(param);
@@ -69,7 +67,6 @@ namespace StartVisionSelector
             }
             catch (Exception e)
             {
-                File.AppendAllText(@"D:\log.txt", path + "\r\n");
                 SaveFileErrorResult(param);
                 return;
             }
@@ -125,11 +122,9 @@ namespace StartVisionSelector
         private static void SaveFileErrorResult(string param)
         {
             Console.WriteLine(param);
-            File.AppendAllText(@"D:\log.txt", param + "\r\n");
             try
             {
                 var tempParam = param.Replace("\\\"", "\""); 
-                File.AppendAllText(@"D:\log.txt", tempParam + "\r\n");
                 JObject jObject = JObject.Parse(tempParam);
                 string key = @"ResultFileName";
                 string path = jObject[key].ToString();
@@ -143,8 +138,6 @@ namespace StartVisionSelector
                     jResult.Add("Result", "Failure");
                     jResult.Add("ResultMsg","文件格式错误或文件打开失败");
                     File.AppendAllText(path, jResult.ToString());
-                    File.AppendAllText(@"D:\log.txt", path.ToString() + "\r\n");
-                    File.AppendAllText(@"D:\log.txt", jResult.ToString() + "\r\n");
                 }
             }
             catch (Exception e)

+ 0 - 3
Starter/Starter/Program.cs

@@ -56,7 +56,6 @@ namespace ExportStart
             {
                 Log4Net.Debug("命令参数错误");
             }
-            File.AppendAllText(@"D:\log.txt", path + "\r\n");
             Log4Net.Info(command);
             Log4Net.Info(path);
             if (File.Exists(path) && Enum.TryParse(command, out CommandType commandType))
@@ -99,8 +98,6 @@ namespace ExportStart
         /// <returns></returns>
         private static void SaveResult(string param, string result)
         {
-            File.AppendAllText(@"D:\log.txt", param+"\r\n");
-            File.AppendAllText(@"D:\log.txt", result + "\r\n");
             Console.WriteLine(param);
             Log4Net.Debug(param);
             Log4Net.Debug(result);