Exemplo n.º 1
0
 /// <param name="msg">错误消息</param>
 /// <param name="logType">日志类型</param>
 /// <param name="module">发生错误文件路径</param>
 /// <param name="methodName">发生错误方法名</param>
 /// <param name="LineNo">发生错误行号</param>
 public static void AddLog(string msg, EnumLogType logType, [CallerFilePath] string module = null, [CallerMemberName] string methodName = null, [CallerLineNumber] int LineNo = 0)
 {
     Task.Factory.StartNew(() =>
     {
         try
         {
             S_Log log       = new S_Log();
             log.Create_Time = GetStr.GetCurrentDate;
             log.Id          = GetStr.GetGuid;
             log.Log_Type    = logType.ToEnumDiscription();
             log.Msg         = msg;
             log.Module      = module;
             log.Category    = methodName;
             log.SubCategory = LineNo + " 行";
             HttpHelp.Post <int, S_Log>(ActionEnum.Add_Log, log);
         }
         catch { }
     });
 }
Exemplo n.º 2
0
 /// <param name="msg">记录的消息</param>
 /// <param name="logType">日志类型</param>
 /// <param name="module">模块</param>
 /// <param name="category">目录</param>
 /// <param name="subCategory">子目录</param>
 public void AddLog(string msg, EnumLogType logType, string module = null, string category = null, string subCategory = null)
 {
     Task.Factory.StartNew(() =>
     {
         try
         {
             S_Log log       = new S_Log();
             log.Create_Time = GetStr.GetCurrentDate;
             log.Id          = GetStr.GetGuid;
             log.Log_Type    = logType.ToEnumDiscription();
             log.Msg         = msg;
             log.Module      = module;
             log.Category    = category;
             log.SubCategory = subCategory;
             new S_LogDAL().Add(new System.Collections.Generic.List <S_Log> {
                 log
             });
         }
         catch { }
     });
 }