Пример #1
0
 /// <summary>
 /// 记录日志
 /// </summary>
 /// <param name="str">日志内容</param>
 /// <param name="addToQueue">是否添加到自定义消息队列</param>
 /// <returns></returns>
 public static string Log(this string str, bool addToQueue = false)
 {
     mediaService.AddDownloadlog(new DownloadLogEntity
     {
         LogId          = Guid.NewGuid(),
         SortValue      = DateTime.Now.ToString("yyyyMMddhhmmssfff"),
         Disabled       = 0,
         Level          = 0,
         Message        = str,
         Rec_CreateBy   = Guid.Parse("3102A7AC-35DF-4C9C-8A11-CE9501EBE300"),
         Rec_CreateTime = DateTime.Now
     });
     if (addToQueue)
     {
         DefineMessageQueue.AddToQueue(str);
     }
     return(str);
 }
Пример #2
0
 /// <summary>
 /// 添加到自定义消息队列
 /// </summary>
 /// <param name="str">日志内容</param>
 /// <param name="addToQueue">是否添加到自定义消息队列</param>
 /// <returns></returns>
 public static string Message(this string str)
 {
     DefineMessageQueue.AddToQueue(str);
     return(str);
 }