/// <summary> /// <see cref="CapturingLogger"/> instances send their captured log events to this method. /// </summary> public virtual void AddEvent(CapturingLoggerEvent loggerEvent) { _lastEvent = loggerEvent; lock (LoggerEvents) { LoggerEvents.Add(loggerEvent); } Owner.AddEvent(LastEvent); }
/// <summary> /// Create a new <see cref="CapturingLoggerEvent"/> and send it to <see cref="CapturingLoggerFactoryAdapter.AddEvent"/> /// </summary> /// <param name="level"></param> /// <param name="message"></param> /// <param name="exception"></param> protected override void WriteInternal(LogLevel level, object message, Exception exception) { LastEvent = new CapturingLoggerEvent(this, level, message, exception); Owner.AddEvent(LastEvent); }