public override void TraceEvent(System.Diagnostics.TraceEventCache eventCache, string source, System.Diagnostics.TraceEventType eventType, int id, string format, params object[] args) { if (this.target.Filter != null && !this.target.Filter.ShouldTrace(eventCache, source, eventType, id, format, args, null, null)) { return; } if (args != null) { this.WriteFormattedLine(new TraceData(source, eventType.ToString()), format, args); } else { this.WriteFormattedLine(new TraceData(source, eventType.ToString()), format); } }
public override void TraceEvent(System.Diagnostics.TraceEventCache eventCache, string source, System.Diagnostics.TraceEventType eventType, int id, string message) { if (this.target.Filter != null && !this.target.Filter.ShouldTrace(eventCache, source, eventType, id, message, null, null, null)) { return; } this.WriteFormattedLine(new TraceData(source, eventType.ToString()), message); }
/// <remarks>Similar to other trace listeners but with no header/footer.</remarks> // ShouldTrace(TraceEventCache cache, string source, TraceEventType eventType, int id, string formatOrMessage, object[] args, object data1) public override void TraceData(System.Diagnostics.TraceEventCache eventCache, string source, System.Diagnostics.TraceEventType eventType, int id, object data) { if (this.target.Filter != null && !this.target.Filter.ShouldTrace(eventCache, source, eventType, id, null, null, data, null)) { return; } string message = string.Empty; if (data != null) { message = data.ToString(); } this.WriteFormattedLine(new TraceData(source, eventType.ToString()), message); }
public override void TraceData(System.Diagnostics.TraceEventCache eventCache, string source, System.Diagnostics.TraceEventType eventType, int id, params object[] data) { if (this.target.Filter != null && !this.target.Filter.ShouldTrace(eventCache, source, eventType, id, null, null, null, data)) { return; } System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder(); if (data != null) { for (int i = 0; i < data.Length; i++) { if (i != 0) { stringBuilder.Append(", "); } if (data[i] != null) { stringBuilder.Append(data[i].ToString()); } } } this.WriteFormattedLine(new TraceData(source, eventType.ToString()), stringBuilder.ToString()); }