include "LoggingJava"
+include "LoggingMDC" as MDC
+
+importJava "org.slf4j.MarkerFactory" where
+ // Note: this method is pure by purpose, because MarkerFactory should always return the same marker
+ @JavaName getMarker
+ marker :: String -> Marker
\ No newline at end of file
--- /dev/null
+include "LoggingJava"
+
+importJava "org.slf4j.MDC" where
+ get :: String -> <Proc> Maybe String
+ put :: String -> String -> <Proc> ()
+ remove :: String -> <Proc> ()
+
+putOrRemove :: String -> Maybe String -> <Proc> ()
+putOrRemove key (Just value) = put key value
+putOrRemove key Nothing = remove key
+
+@inline
+withContext :: String -> String -> (<e> a) -> <e,Proc> a
+withContext key value procedure = result
+ where
+ oldValue = get key
+ put key value
+ result = procedure
+ putOrRemove key oldValue
\ No newline at end of file