Class TraceSourceCommandEventSubscriber
- Namespace
- MongoDB.Driver.Core.Events.Diagnostics
- Assembly
- MongoDB.Driver.Core.dll
An event subscriber that writes command events to a trace source.
public sealed class TraceSourceCommandEventSubscriber : IEventSubscriber
- Inheritance
-
TraceSourceCommandEventSubscriber
- Implements
- Inherited Members
Constructors
TraceSourceCommandEventSubscriber(TraceSource)
Initializes a new instance of the TraceSourceCommandEventSubscriber class.
public TraceSourceCommandEventSubscriber(TraceSource traceSource)
Parameters
traceSource
TraceSourceThe trace source.
Methods
TryGetEventHandler<TEvent>(out Action<TEvent>)
Tries to get an event handler for an event of type TEvent.
public bool TryGetEventHandler<TEvent>(out Action<TEvent> handler)
Parameters
handler
Action<TEvent>The handler.
Returns
- bool
true
if this subscriber has provided an event handler; otherwisefalse
.
Type Parameters
TEvent
The type of the event.