@@ -35,6 +35,7 @@ module Katip.Monadic
35 , katipAddContext
35 , katipAddContext
36 , KatipContextTState(..)
36 , KatipContextTState(..)
37 , NoLoggingT
37 , NoLoggingT
@@ -486,3 +487,10 @@ instance MonadIO m => KatipContext (NoLoggingT m) where
486 localKatipContext = const id
487 localKatipContext = const id
487 getKatipNamespace = pure mempty
488 getKatipNamespace = pure mempty
488 localKatipNamespace = const id
489 localKatipNamespace = const id
491+askLoggerIO :: (Applicative m, KatipContext m) => m (Severity -> LogStr -> IO ())
493+ ctx <- getKatipContext
494+ ns <- getKatipNamespace
496+ pure (\sev msg -> runKatipT logEnv $ logF ctx ns sev msg)