PostSharp 2023.0 / / Post­Sharp Documentation / API Reference / Post­Sharp.​Patterns.​Diagnostics.​Adapters.​Diagnostic­Source Namespace / Diagnostic­Source­Collecting­Listener Class

DiagnosticSourceCollectingListener Class

Subscribes to DiagnosticListener and emits messages and activities to PostSharp Logging. After calling the constructor, you must call the FollowActivity(String, IDiagnosticSourceActivityFilter) and then Subscribe() methods to start listening to events.
Inheritance Hierarchy
System.Object
  PostSharp.Patterns.Diagnostics.Adapters.DiagnosticSource.DiagnosticSourceCollectingListener

Namespace:  PostSharp.Patterns.Diagnostics.Adapters.DiagnosticSource
Assembly:  PostSharp.Patterns.Diagnostics.Adapters.DiagnosticSource (in PostSharp.Patterns.Diagnostics.Adapters.DiagnosticSource.dll) Version: 2023.0.3.0 (2023.0.3.0)
Syntax
C#
public sealed class DiagnosticSourceCollectingListener : IObserver<DiagnosticListener>, 
	IDisposable

The DiagnosticSourceCollectingListener type exposes the following members.

Constructors
  NameDescription
Public methodDiagnosticSourceCollectingListener(LogLevel)
Initializes a new DiagnosticSourceCollectingListener and subscribes to all sources.
Public methodDiagnosticSourceCollectingListener(String[], LogLevel)
Initializes a new DiagnosticSourceCollectingListener and specifies the list of sources to follow.
Methods
  NameDescription
Public methodDispose
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Public methodFollowActivity
Follows a specific activity.
Public methodSubscribe
Subscribes to event sources.
See Also