示例#1
0
 public static void Write(Exception ex)
 {
     if (MessageConsole._onLogger != null)
     {
         MessageConsole._onLogger(ex.Message + "\r\n\t" + ex.StackTrace, LogLevel.Error);
     }
     else
     {
         Log.WriteLog(ex.Message + "\r\n\t" + ex.StackTrace, LogLevel.Error);
     }
 }
示例#2
0
 public static void Write(string msg, LogLevel level = LogLevel.Common)
 {
     if (MessageConsole._onLogger != null)
     {
         MessageConsole._onLogger(msg, level);
     }
     else
     {
         DateTime dtime = DateTime.Now;
         string   txt   = "[" + dtime + "] " + msg;
         Common.Log.WriteLog(txt, level);
     }
 }