Tracer

class Tracer(id: String?)

An append-only, thread-safe trace buffer that can be snapshotted and rolled back.

All state mutations are guarded by lock, ensuring atomicity across threads.

Constructors

Link copied to clipboard
constructor(id: String?)

Functions

Link copied to clipboard
fun dispose()

Permanently discards all buffered trace entries.

Link copied to clipboard

Returns true if tracing is enabled, false otherwise.

Link copied to clipboard
fun setEnabled(enabled: Boolean)

Enables or disables tracing.

Link copied to clipboard

Returns a snapshot of the current buffer and clears it.

Link copied to clipboard
fun trace(tag: String, data: Any?)

Records a trace entry when tracing is enabled.