Trace
Models a curated call stack from some root, up to this Trace node. In practice, the root will be ModuleCheckRunner.run
.
This class this leverages CoroutineContext.Element in order to avoid passing a 'TraceContext' around. Trace nodes are stored in the CoroutineContext. This means that traces can only be started or added to from within a coroutine.
The simplest way to add to a trace is to make the class implement HasTraceTags to provide static tags, then use one of the traced extensions at the trace site.
class SomeClass : HasTraceTags {
override val traceTags = listOf(SomeClass::class)
suspend fun doSomethingImportant(someArgument: String) {
traced(someArgument) { /* anything happening here is wrapped in the new Trace */}
}
}
Content copied to clipboard
Since
0.12.0
Inheritors
Types
Properties
Functions
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Unsafe-ish extension for extracting a Trace from inside a coroutine.