Table of Contents

Struct InstrumentsAccessor

Namespace
Xui.Core.Debug
Assembly
Xui.Core.dll

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

sink IViewInstrumentsSink

The sink to write to, or null to 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

scope Scope

The instrumentation scope.

lod LevelOfDetail

The level of detail for filtering.

message InstrumentsInterpolatedStringHandler

The 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

scope Scope

The instrumentation scope.

lod LevelOfDetail

The level of detail for filtering.

message InstrumentsInterpolatedStringHandler

The 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

elapsedTicks long

TrackView(Scope, View)

Reports structured traversal of view without formatting a message.

public void TrackView(Scope scope, View view)

Parameters

scope Scope
view View