From 7b60238359b94125d591678eff105ae2bf47843f Mon Sep 17 00:00:00 2001
From: gxc <guoxuecheng@guoxuechengdeMacBook-Pro.local>
Date: 星期五, 15 十一月 2019 13:16:21 +0800
Subject: [PATCH] 2019.11.15
---
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlLogLogic.cs | 33 ++++++++++++++++++++-------------
1 files changed, 20 insertions(+), 13 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlLogLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlLogLogic.cs
index df93dac..2895fed 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlLogLogic.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlLogLogic.cs
@@ -60,20 +60,27 @@
{
lock (objLock)
{
- //if (div != -1)
- //{
- // //鏆傛椂鍙褰曞紓甯镐俊鎭�
- // return;
- //}
+ if (div != -1)
+ {
+ //鏆傛椂鍙褰曞紓甯镐俊鎭�
+ return;
+ }
//Log鏂囦欢
- string fileName = this.GetLogFile(div);
- string fullName = UserCenterLogic.CombinePath(DirNameResourse.LocalMemoryDirectory, DirNameResourse.LogDirectory, fileName);
-
- strLog = "[" + DateTime.Now.ToString("yyyyMMdd HH:mm:ss") + "] " + strLog + "\r\n";
- var sw = new System.IO.StreamWriter(fullName, true, Encoding.UTF8);
- sw.WriteLine(strLog);
- sw.Close();
- sw = null;
+ System.IO.StreamWriter sw = null;
+ try
+ {
+ string fileName = this.GetLogFile(div);
+ string fullName = UserCenterLogic.CombinePath(DirNameResourse.LocalMemoryDirectory, DirNameResourse.LogDirectory, fileName);
+ strLog = "[" + DateTime.Now.ToString("yyyyMMdd HH:mm:ss") + "] " + strLog + "\r\n";
+ sw = new System.IO.StreamWriter(fullName, true, Encoding.UTF8);
+ sw.WriteLine(strLog);
+ }
+ catch { }
+ finally
+ {
+ sw?.Close();
+ sw = null;
+ }
}
}
--
Gitblit v1.8.0