Skip to content

Interface ITraceWriter

Definition

Namespace: StardewUI.Diagnostics
Assembly: StardewUI.dll

Abstract output writer for performance traces.

public interface ITraceWriter

Remarks

This is an internal helper meant for use by the Trace utility and should not be used directly by mods.

Members

Properties

Name Description
IsTracing Whether or not a trace has been started, and not yet ended.

Methods

Name Description
BeginSlice(string) Begins tracking a new operation (slice).
BeginTrace() Starts a new trace.
EndTrace() Ends the current trace and writes all recorded data to a new trace file in the output directory.

Details

Properties

IsTracing

Whether or not a trace has been started, and not yet ended.

bool IsTracing { get; }
Property Value

Boolean


Methods

BeginSlice(string)

Begins tracking a new operation (slice).

System.IDisposable BeginSlice(string name);
Parameters

name   string
The name that should appear in the trace log/visualization.

Returns

IDisposable

A disposable instance which, when disposed, stops tracking this operation and records the duration it took, for subsequent writing to the trace file.

Remarks

Slices must be disposed in the opposite order in which they are created, otherwise the final trace may be considered invalid.


BeginTrace()

Starts a new trace.

void BeginTrace();

EndTrace()

Ends the current trace and writes all recorded data to a new trace file in the output directory.

void EndTrace();