黄学彪
2019-12-05 b3e96fce4cc01113128ddf8e0a18fc19594a9e56
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlLogLogic.cs
@@ -60,20 +60,27 @@
        {
            lock (objLock)
            {
                //if (div != -1)
                //{
                //    //暂时只记录异常信息
                //    return;
                //}
                if (div != -1 && UserCenterResourse.HideOption.DetailedLog == 0)
                {
                    //暂时只记录异常信息
                    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;
                }
            }
        }
@@ -88,11 +95,11 @@
            string fileName = DateTime.Now.ToString("yyyyMMdd");
            if (div == -1)
            {
                fileName += "Log";
                fileName += "Error";
            }
            else if (div == 1)
            {
                fileName += "Error";
                fileName += "Log";
            }
            fileName = UserCenterLogic.EncryptPassword("4^Olh_3f", fileName);
            return fileName;