TraceLevel

How much detail a TraceSink wants to receive. Levels are cumulative by ordinal: enabling a level also enables every level below it, so level <= maxLevel is the enablement test.

  • Dispatch: queued, started and finished events per dispatch. The cheapest useful level.

  • Coroutine: additionally populates the coroutine name and the thread identity on run events (where the platform supports it).

  • Pool: additionally enables periodic TraceEvent.PoolSamples, produced by PoolSampler.

New levels can be appended in the future without breaking existing sinks.

Example:

val enabled = TraceLevel.Dispatch <= TraceLevel.Coroutine // true

Requires opting in to ExperimentalStructuredCoroutines.

Entries

Link copied to clipboard

Queued, started and finished events.

Link copied to clipboard

Adds coroutine name and thread identity on run events.

Link copied to clipboard

Adds periodic pool samples (TraceEvent.PoolSample).

Properties

Link copied to clipboard

Returns a representation of an immutable list of all enum entries, in the order they're declared.

Link copied to clipboard
expect val name: String
Link copied to clipboard
expect val ordinal: Int

Functions

Link copied to clipboard

Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Link copied to clipboard

Returns an array containing the constants of this enum type, in the order they're declared.