Package-level declarations

LogContext class for storing information in a coroutine scope.

Types

Link copied to clipboard
object Context

Object for configuring context information that will be included in log events.

Link copied to clipboard
typealias ContextItem = Pair<String, Any?>

Type alias for an item in a context.

Link copied to clipboard
typealias ItemExtractor = () -> EventItems

Functional type that returns a map of context items.

Link copied to clipboard

Container for objects to be stored in coroutine contexts and used in logging.

Functions

Link copied to clipboard
suspend fun addToContext(vararg items: ContextItem)

Adds zero or more items to the LogContext in the current coroutine scope.

Link copied to clipboard
suspend fun logContext(vararg items: ContextItem): CoroutineContext

Utility function for constructing a LogContext with specified items.

Link copied to clipboard
suspend fun removeFromContext(vararg keys: String)

Removes zero or more items from the LogContext in the current coroutine scope.

Link copied to clipboard
suspend fun <R> withLogContext(vararg items: ContextItem, block: suspend CoroutineScope.() -> R): R

Utility function that stores items into a LogContext in the current coroutine scope.