protected override void OnSaveLog(TraceLog log)
 {
     if (this.isDebugMode)
     {
         Console.WriteLine(String.Format("{0}: {1}",
             log.DateTime.ToString("HH-mm-ss"), log.Content));
     }
 }
Exemplo n.º 2
0
        public static TraceLog Create(LogType logType, string content)
        {
            TraceLog traceLog = new TraceLog();
            traceLog.LogType = logType;
            traceLog.DateTime = DateTime.Now;
            traceLog.Content = content;
            traceLog.ThreadId = System.Threading.Thread.CurrentThread.ManagedThreadId;
            traceLog.ThreadName = System.Threading.Thread.CurrentThread.Name;
            traceLog.logStr = traceLog.SerializeToStr();

            return traceLog;
        }