/// <summary> /// Audits a given message and sorts the <see cref="Items"/> list /// by the submitted timestamps. /// </summary> /// <param name="item">Encapsulates information to be /// audited.</param> /// <exception cref="ArgumentNullException">If <paramref name="item"/> /// is a null reference.</exception> public void Audit(AuditItem item) { if(!IsAuditEnabled(item.Level, item.Context)) return; lock (this) { Items.Add(item); Items.Sort((a1, a2) => a1.Timestamp.CompareTo(a2.Timestamp)); } }
/// <summary> /// Audits a given message and sorts the <see cref="Items"/> list /// by the submitted timestamps. /// </summary> /// <param name="item">Encapsulates information to be /// audited.</param> /// <exception cref="ArgumentNullException">If <paramref name="item"/> /// is a null reference.</exception> public void Audit(AuditItem item) { if (!IsAuditEnabled(item.Level, item.Context)) { return; } lock (this) { Items.Add(item); Items.Sort((a1, a2) => a1.Timestamp.CompareTo(a2.Timestamp)); } }
/// <summary> /// The <see cref="NullAuditor"/> discards all submitted messages. /// </summary> /// <param name="item">Encapsulates information to be /// audited.</param> /// <exception cref="ArgumentNullException">If <paramref name="item"/> /// is a null reference.</exception> public void Audit(AuditItem item) { Ensure.ArgumentNotNull(item, "item"); }
/// <summary> /// Audits a given incident. /// </summary> /// <param name="item">Encapsulates information to be /// audited.</param> /// <exception cref="ArgumentNullException">If <paramref name="item"/> /// is a null reference.</exception> public void Audit(AuditItem item) { Console.Out.WriteLine(); Console.Out.WriteLine(item.CreateAuditString()); Console.Out.WriteLine(); }