Struct InstrumentsAccessor
Lightweight zero-allocation facade over an IInstrumentsSink for logging and tracing. All formatting is skipped when the sink is disabled for the given scope and level.
public readonly struct InstrumentsAccessor
- Inherited Members
- Extension Methods
Constructors
InstrumentsAccessor(IViewInstrumentsSink?)
Initializes a new accessor backed by the given sink.
public InstrumentsAccessor(IViewInstrumentsSink? sink)
Parameters
sinkIViewInstrumentsSinkThe sink to write to, or
nullto produce a no-op accessor.
Methods
BeginFrame()
Begins a render-surface update frame when supported by the current sink.
public void BeginFrame()
EndFrame()
Completes a render-surface update frame when supported by the current sink.
public void EndFrame()
Log(Scope, LevelOfDetail, ref InstrumentsInterpolatedStringHandler)
Logs a formatted message at the given scope and level of detail.
public void Log(Scope scope, LevelOfDetail lod, ref InstrumentsInterpolatedStringHandler message)
Parameters
scopeScopeThe instrumentation scope.
lodLevelOfDetailThe level of detail for filtering.
messageInstrumentsInterpolatedStringHandlerThe interpolated message string. Not evaluated when the sink is disabled.
Trace(Scope, LevelOfDetail, ref InstrumentsInterpolatedStringHandler)
Begins a named trace scope and returns a TraceScope that ends it when disposed.
public TraceScope Trace(Scope scope, LevelOfDetail lod, ref InstrumentsInterpolatedStringHandler message)
Parameters
scopeScopeThe instrumentation scope.
lodLevelOfDetailThe level of detail for filtering.
messageInstrumentsInterpolatedStringHandlerThe interpolated trace label. Not evaluated when the sink is disabled.
Returns
- TraceScope
A TraceScope that calls EndTrace(IRenderSurfaceInstrumentsSink) on dispose.
TrackTextMeasure(long)
Reports an underlying text measurement without formatting a message.
public void TrackTextMeasure(long elapsedTicks)
Parameters
elapsedTickslong
TrackView(Scope, View)
Reports structured traversal of view without formatting a message.
public void TrackView(Scope scope, View view)