public virtual void NotifyGeneric(EventEntry entry) { if (NotifyEvent != null) { if (entry.LoggedBy == null) { entry.LoggedBy = InstanceId; } if (!entry.LoggedBy.Contains(InstanceId)) { entry.LoggedBy = string.Format("{0}-{1}", InstanceId, entry.LoggedBy); } #if DEBUG //Debug.WriteLine(string.Format("{0}\t{1}\t{2}", entry.Time, entry.Level.ToString(), entry.Message)); #endif NotifyEvent(entry); } }
//public event OnCommitHandler OnCommit = null; /// <summary> /// Pushes the log entry to all registered <see cref="BaseLogDestination"/>s, in addition to calling notifying all NotifyEvent consumers. /// </summary> /// <param name="EventEntry">The log entry.</param> public override void NotifyGeneric(EventEntry EventEntry) { if (Categories != null && Categories.Count > 0) { EventEntry.Categories.AddRange(Categories); EventEntry.Categories = EventEntry.Categories.Distinct().ToList(); } base.NotifyGeneric(EventEntry); foreach (BaseLogDestination destination in Destinations) { if (destination.ShouldLog(EventEntry)) { destination.Log(EventEntry); } } }
public EventEntry CreateEventEntry() { var entry = new EventEntry(GetCallerMethodName(), string.Empty, (int)EventSeverity.Verbose); entry.LoggedBy = InstanceId; return entry; }
public EventEntry CreateEventEntry(string caller, int severity, string message) { var entry = new EventEntry(caller, message, severity); entry.LoggedBy = InstanceId; return entry; }
public override void Log(EventEntry entry) { lock (logListLock) base.Log(entry); }