PostSharp 2023.0 / / Post­Sharp Documentation / API Reference / Post­Sharp.​Patterns.​Diagnostics.​Backends.​Trace Namespace / Trace­Collecting­Trace­Listener Class / Trace­Collecting­Trace­Listener Methods / Trace­Collecting­Trace­Listener.​Redirect­Logging­To­Post­Sharp Method

TraceCollectingTraceListener.RedirectLoggingToPostSharp Method

Redirects all Trace events to be sent to PostSharp and clears all other listeners from Listeners. Those listeners are returned in the return value.

Namespace:  PostSharp.Patterns.Diagnostics.Backends.Trace
Assembly:  PostSharp.Patterns.Diagnostics.Backends.Tracing (in PostSharp.Patterns.Diagnostics.Backends.Tracing.dll) Version: 2023.0.3.0 (2023.0.3.0)
Syntax
C#
public static List<TraceListener> RedirectLoggingToPostSharp()

Return Value

Type: List<TraceListener>
Listeners previously in the Listeners collections, excluding the new TraceCollectingTraceListener.
See Also