A trace listener that sends all events to PostSharp as the log source "TraceCollectingTraceListener".
Inheritance
Implements
Namespace: PostSharp.Patterns.Diagnostics.Backends.Trace
Assembly: PostSharp.Patterns.Diagnostics.Backends.Tracing.dll
Syntax
public class TraceCollectingTraceListener : BaseCollectingTraceListener, IDisposableRemarks
Use RedirectLoggingToPostSharp() to install this listener after you have added your output listeners to Listeners. Pass the listeners that the method returns to the TraceLoggingBackend(IEnumerable<TraceListener>, string) constructor, so that manual and automatic log records reach the same listeners through the same backend and share the same indentation.
Constructors
| Name | Description |
|---|---|
| TraceCollectingTraceListener() | Initializes a new instance of the TraceCollectingTraceListener class. |
Methods
| Name | Description |
|---|---|
| RedirectLoggingToPostSharp() | Redirects all Trace events to PostSharp and clears all other listeners from Listeners. The method returns the listeners that it cleared. |
| TraceCore(string, TraceEventType, string) | Sends an event to PostSharp. You provide the |
| TraceCore(string, TraceEventType, string, object[]) | Sends an event to PostSharp. The text is provided as a formatting string and an array of parameters. |