Skip to content

opensavvy.sentier.coroutines

Types

SentierContext

Stores the current task into the CoroutineContext of a coroutine.

Functions

asCoroutineContext

currentSpan

suspend fun currentSpan(): Span

currentSpanOrNull

suspend fun currentSpanOrNull(): Span?

debug

inline suspend fun debug(values: SentierValues = SentierValues.Empty, description: () -> String)

Logs an event at level LogLevel.Debug in this coroutine.

error

inline suspend fun error(values: SentierValues = SentierValues.Empty, description: () -> String)

Logs an event at level LogLevel.Error in this coroutine.

fatal

inline suspend fun fatal(values: SentierValues = SentierValues.Empty, description: () -> String)

Logs an event at level LogLevel.Fatal in this coroutine.

info

inline suspend fun info(values: SentierValues = SentierValues.Empty, description: () -> String)

Logs an event at level LogLevel.Info in this coroutine.

task

inline suspend fun <T> task(
    message: () -> String, 
    values: SentierValues = SentierValues.Empty, 
    crossinline block: suspend CoroutineScope.() -> T
): T

Tracks the progress of block in a child Span.

trace

inline suspend fun trace(values: SentierValues = SentierValues.Empty, description: () -> String)

Logs an event at level LogLevel.Trace in this coroutine.

useCurrentSpan

inline suspend fun <T> useCurrentSpan(block: Span.() -> T): T

warn

inline suspend fun warn(values: SentierValues = SentierValues.Empty, description: () -> String)

Logs an event at level LogLevel.Warning in this coroutine.