@@ -16,12 +16,14 @@ module Control.Logger.Internal
17import Control.Has
17import Control.Has
18import Control.Lens
18import Control.Lens
19−import Control.Monad.IO.Class
20import Control.DeepSeq
19import Control.DeepSeq
21−import Data.Aeson (ToJSON, FromJSON, Object, Value(..))
20+import Data.Aeson (ToJSON, FromJSON, Object)
22import Data.Text (Text)
21import Data.Text (Text)
23import Data.Monoid
22import Data.Monoid
24import GHC.Stack
23import GHC.Stack
24+#if MIN_VERSION_mtl(2,3,0)
25+import Control.Monad.IO.Class
27data LogSeverity
29data LogSeverity
@@ -77,18 +79,4 @@ logMsgWith logger s t =
77 liftIO $ runLogger logger callStack s t
79 liftIO $ runLogger logger callStack s t
79runLogger :: Logger -> CallStack -> LogSeverity -> Text -> IO ()
81runLogger :: Logger -> CallStack -> LogSeverity -> Text -> IO ()
80−runLogger (Logger ctx theScrubber logger) cs ls txt
82+runLogger (Logger ctx theScrubber logger) cs ls txt = logger ctx cs ls (appEndo theScrubber txt)
81− = logger (scrubContext theScrubber ctx) cs ls (appEndo theScrubber txt)
84−scrubContext :: Endo Text -> Object -> Object
85−scrubContext theScrubber = fmap doScrub
87− doScrub :: Value -> Value
89− Object object -> Object (fmap doScrub object)
90− Array array -> Array (fmap doScrub array)
91− String string -> String (appEndo theScrubber string)