withLogCtx

inline suspend fun <R> withLogCtx(vararg kvPairs: <Error class: unknown class><String, Any>, crossinline block: suspend () -> R): R

Execute block with key/value pairs set in the logging context. These will be automatically added to any log record executed via CoroutineContext.log.

Return

returns the result of executing block

Parameters

kvPairs

the key/value pairs to add to log records

block

the block of code to execute with the given logging context