-
-
Notifications
You must be signed in to change notification settings - Fork 125
Closed
Description
Consider adding some additional functions for managing MDC (Javadoc: https://www.slf4j.org/api/org/slf4j/MDC.html) by putting and removing keys
Additional consideration: it would be great to have it with coroutines
Docs: https://www.slf4j.org/manual.html#mdc
I don't have a concrete API proposal but here is some initial thoughts:
object MDC {
// additional overloads for varargs and up to some N number of `Pair`
fun <T> withContext(keyPair: Pair<String, String>, body: () -> T) {
return org.slf4j.MDC.putCloseable(keyPair.first, keyPair.second).use {
body()
}
}
}
Metadata
Metadata
Assignees
Labels
No labels