Class Trace
Definition
Namespace: StardewUI.Diagnostics
Assembly: StardewUI.dll
Provides methods to toggle tracing and write to the current trace.
Inheritance
Object ⇦ Trace
Members
Properties
Name | Description |
---|---|
IsTracing | Gets or sets whether tracing is active. |
Methods
Name | Description |
---|---|
Begin(string) | Begins tracking a new operation (slice). |
Begin(Func<string>, string) | Begins tracking a new operation (slice). |
Begin(Object, string) | Begins tracking a new operation (slice). |
Details
Properties
IsTracing
Gets or sets whether tracing is active.
Property Value
Remarks
While inactive, all calls to any of the Begin(string) overloads are ignored and return null
. If tracing is active, then setting this to false
will cause the trace file to be written automatically.
Methods
Begin(string)
Begins tracking a new operation (slice).
Parameters
name
string
The name that should appear in the trace log/visualization.
Returns
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.
Begin(Func<string>, string)
Begins tracking a new operation (slice).
Parameters
callerName
Func<string>
Reference to the name (e.g. type name) of the object performing the traced operation.
memberName
string
Name of the member (method or property) about to begin execution.
Returns
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.
Begin(Object, string)
Begins tracking a new operation (slice).
Parameters
caller
Object
Reference to the object performing the traced operation.
memberName
string
Name of the member (method or property) about to begin execution.
Returns
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.