with Logging Context Async
inline suspend fun <T> withLoggingContextAsync( pair: Pair<String, String?>, restorePrevious: Boolean = true, crossinline body: suspend () -> T): T
Content copied to clipboard
Use a pair in an asynchronous MDC context. Example:
withLoggingContextAsync("userId" to userId) {
doSomething()
}
Content copied to clipboard
withLoggingContextAsync("userId" to userId, restorePrevious = false) {
doSomething()
}
Content copied to clipboard
inline suspend fun <T> withLoggingContextAsync( vararg pair: Pair<String, String?>, restorePrevious: Boolean = true, crossinline body: suspend () -> T): T
Content copied to clipboard
Use a varying number of pairs in an asynchronous MDC context. Example:
withLoggingContextAsync("userId" to userId) {
doSomething()
}
Content copied to clipboard
inline suspend fun <T> withLoggingContextAsync( map: Map<String, String?>, restorePrevious: Boolean = true, crossinline body: suspend () -> T): T
Content copied to clipboard
Use a map in an asynchronous MDC context. Example:
withLoggingContextAsync(mapOf("userId" to userId)) {
doSomething()
}
Content copied to clipboard
withLoggingContextAsync(mapOf("userId" to userId), restorePrevious = true) {
doSomething()
}
Content copied to clipboard