Skip to content

DiagnosticEventCollector Constructors

A test utility for collecting and waiting on diagnostic events. Subscribes to System.Diagnostics.DiagnosticListener.AllListeners and captures events from listeners matching specified patterns.

DiagnosticEventCollector(IEnumerable<string>)

View source
public DiagnosticEventCollector(IEnumerable<string>? listenerPrefixes = null)
Creates a new diagnostic event collector that subscribes to listeners with names starting with any of the specified prefixes.

Parameters

listenerPrefixesIEnumerable<string>
Prefixes of listener names to subscribe to (e.g., "Orleans." to capture all Orleans events). If empty, subscribes to all listeners.

DiagnosticEventCollector(string[])

View source
public DiagnosticEventCollector(params string[] listenerPrefixes)
Creates a new diagnostic event collector that subscribes to listeners with names starting with any of the specified prefixes.

Parameters

listenerPrefixesstring[]
Prefixes of listener names to subscribe to (e.g., "Orleans." to capture all Orleans events). If empty, subscribes to all listeners.