vy commented on issue #71: URL: https://github.com/apache/logging-log4j-kotlin/issues/71#issuecomment-1997814563
@rocketraman, AFAIC, the problem is the lack of a dynamically scoped variable (you might be familiar with this concept if you have ever used a Lisp dialect), and hence, we use the one closest to that: a thread-local one. Imagine `ThreadContext` is a [`ScopedValue`](https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/ScopedValue.html). Your `withContextMap(map: Map<String, String>, block: () -> T)` could simply be represented as `ThreadContext.runWhere("mdcKey", "mdcVal", doStuff())`. Am I missing something? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@logging.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org