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
Constructors
Types
Functions
Link copied to clipboard
open operator override fun <E : CoroutineContext.Element> get(key: CoroutineContext.Key<E>): E?
Content copied to clipboard
Link copied to clipboard
open override fun minusKey(key: CoroutineContext.Key<*>): CoroutineContext
Content copied to clipboard
Link copied to clipboard