Beispiel #1
0
 public static void LogMessage(this Logger logger, LogMessage lm)
 {
     if (logger != null)
         logger.Log(lm);
 }
Beispiel #2
0
        internal void Log(LogMessage lm)
        {
            if (!Enabled)
                return;

            if (lm.Time == default(DateTime))
                lm.Time = DateTime.Now;

            var le = new LogEntry
            {
                Message = lm,
                LoggerName = LogName
            };

            LogEntry(le);

            if (OnLogEntry != null)
                OnLogEntry(this, new LogEntryEventArgs { LogEntry = le });
        }