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(IInstrumentsSink?)

Initializes a new accessor backed by the given sink.

public InstrumentsAccessor(IInstrumentsSink? sink)

Parameters

sink IInstrumentsSink

The sink to write to, or null to produce a no-op accessor.

Methods

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() on dispose.