@@ -40,13 +40,17 @@ import Control.Monad.Trans.Except
4040import Control.Monad.Trans.Maybe
4141import Control.Monad.Trans.Reader
4242import Control.Monad.Trans.Resource (ResourceT)
43−import Control.Monad.Trans.State
44−import Control.Monad.Trans.Writer
45−import Data.Aeson (FromJSON (..),
46− ToJSON (..), object)
47−import qualified Data.Aeson as A
48−import Data.Foldable as FT
49−import qualified Data.HashMap.Strict as HM
43+import Control.Monad.Trans.State.Lazy (StateT)
44+import qualified Control.Monad.Trans.State.Strict as Strict (StateT)
45+import Control.Monad.Trans.Writer.Lazy (WriterT)
46+import qualified Control.Monad.Trans.Writer.Strict as Strict (WriterT)
47+import Control.Monad.Trans.RWS.Lazy (RWST)
48+import qualified Control.Monad.Trans.RWS.Strict as Strict (RWST)
49+import Data.Aeson (FromJSON (..), ToJSON (..),
50+ object)
51+import qualified Data.Aeson as A
52+import Data.Foldable as FT
53+import qualified Data.HashMap.Strict as HM
5054import Data.List
5155import qualified Data.Map.Strict as M
5256import Data.Semigroup
@@ -174,7 +178,7 @@ instance FromJSON Severity where
174178
175179
176180-------------------------------------------------------------------------------
177−-- | Log message with Builder unerneath; use '<>' to concat in O(1).
181+-- | Log message with Builder underneath; use '<>' to concat in O(1).
178182newtype LogStr = LogStr { unLogStr :: B.Builder }
179183 deriving (Generic, Show)
180184
@@ -198,7 +202,7 @@ instance FromJSON LogStr where
198202
199203-------------------------------------------------------------------------------
200204-- | Pack any string-like thing into a 'LogStr'. This will
201−-- automatically work on 'String', 'ByteString, 'Text' and any of the
205+-- automatically work on 'String', 'ByteString', 'Text' and any of the
202206-- lazy variants.
203207logStr :: StringConv a Text => a -> LogStr
204208logStr t = LogStr (B.fromText $ toS t)
@@ -498,7 +502,7 @@ itemJson verb a = toJSON $ a & itemPayload %~ payloadObject verb
498502-- Handle scribe does.
499503--
500504-- 2. Return a finalizing function that tells the scribe to shut
501−-- down. @katip-elasticsearch@'s @mkEsScribe@ returns a @IO (Scribe,
505+-- down. @katip-elasticsearch@'s @mkEsScribe@ returns an @IO (Scribe,
502506-- IO ())@. The finalizer will flush any queued log messages and shut
503507-- down gracefully before returning. This can be hooked into your
504508-- application's shutdown routine to ensure you never miss any log
@@ -718,14 +722,24 @@ instance Katip m => Katip (ExceptT s m) where
718722instance Katip m => Katip (MaybeT m) where
719723 getLogEnv = lift getLogEnv
720724
721−
722725instance Katip m => Katip (StateT s m) where
723726 getLogEnv = lift getLogEnv
724727
728+instance (Katip m, Monoid w) => Katip (RWST r w s m) where
729+ getLogEnv = lift getLogEnv
730+
731+instance (Katip m, Monoid w) => Katip (Strict.RWST r w s m) where
732+ getLogEnv = lift getLogEnv
733+
734+instance Katip m => Katip (Strict.StateT s m) where
735+ getLogEnv = lift getLogEnv
725736
726737instance (Katip m, Monoid s) => Katip (WriterT s m) where
727738 getLogEnv = lift getLogEnv
728739
740+instance (Katip m, Monoid s) => Katip (Strict.WriterT s m) where
741+ getLogEnv = lift getLogEnv
742+
729743instance (Katip m) => Katip (ResourceT m) where
730744 getLogEnv = lift getLogEnv
731745