System.Diagnostics
Namespace with 2 public types
Classes
DiagnosticListener
A DiagnosticListener is something that forwards on events written with DiagnosticSource.
It is an IObservable (has Subscribe method), and it also has a Subscribe overload that
lets you specify a 'IsEnabled' predicate that users of DiagnosticSource will use for
'quick checks'.
The item in the stream is a KeyValuePair[string, object] where the string is the name
of the diagnostic item and the object is the payload (typically an anonymous type).
There may be many DiagnosticListeners in the system, but we encourage the use of
The DiagnosticSource.DefaultSource which goes to the DiagnosticListener.DefaultListener.
If you need to see 'everything' you can subscribe to the 'AllListeners' event that
will fire for every live DiagnosticListener in the appdomain (past or present).
Abstract Classes
DiagnosticSource
This is the basic API to 'hook' parts of the framework. It is like an EventSource
(which can also write object), but is intended to log complex objects that can't be serialized.