katip 0.8.1.0 → 0.8.2.0
raw patch · 5 files changed
+23/−2 lines, 5 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
+ Katip.Core: instance Control.Monad.Fail.MonadFail m => Control.Monad.Fail.MonadFail (Katip.Core.KatipT m)
+ Katip.Monadic: instance Control.Monad.Fail.MonadFail m => Control.Monad.Fail.MonadFail (Katip.Monadic.KatipContextT m)
- Katip: itemApp :: forall a_aeH9. Lens' (Item a_aeH9) Namespace
+ Katip: itemApp :: forall a_aeHF. Lens' (Item a_aeHF) Namespace
- Katip: itemEnv :: forall a_aeH9. Lens' (Item a_aeH9) Environment
+ Katip: itemEnv :: forall a_aeHF. Lens' (Item a_aeHF) Environment
- Katip: itemHost :: forall a_aeH9. Lens' (Item a_aeH9) HostName
+ Katip: itemHost :: forall a_aeHF. Lens' (Item a_aeHF) HostName
- Katip: itemLoc :: forall a_aeH9. Lens' (Item a_aeH9) (Maybe Loc)
+ Katip: itemLoc :: forall a_aeHF. Lens' (Item a_aeHF) (Maybe Loc)
- Katip: itemMessage :: forall a_aeH9. Lens' (Item a_aeH9) LogStr
+ Katip: itemMessage :: forall a_aeHF. Lens' (Item a_aeHF) LogStr
- Katip: itemNamespace :: forall a_aeH9. Lens' (Item a_aeH9) Namespace
+ Katip: itemNamespace :: forall a_aeHF. Lens' (Item a_aeHF) Namespace
- Katip: itemPayload :: forall a_aeH9 a_al3b. Lens (Item a_aeH9) (Item a_al3b) a_aeH9 a_al3b
+ Katip: itemPayload :: forall a_aeHF a_al3H. Lens (Item a_aeHF) (Item a_al3H) a_aeHF a_al3H
- Katip: itemProcess :: forall a_aeH9. Lens' (Item a_aeH9) ProcessID
+ Katip: itemProcess :: forall a_aeHF. Lens' (Item a_aeHF) ProcessID
- Katip: itemSeverity :: forall a_aeH9. Lens' (Item a_aeH9) Severity
+ Katip: itemSeverity :: forall a_aeHF. Lens' (Item a_aeHF) Severity
- Katip: itemThread :: forall a_aeH9. Lens' (Item a_aeH9) ThreadIdText
+ Katip: itemThread :: forall a_aeHF. Lens' (Item a_aeHF) ThreadIdText
- Katip: itemTime :: forall a_aeH9. Lens' (Item a_aeH9) UTCTime
+ Katip: itemTime :: forall a_aeHF. Lens' (Item a_aeHF) UTCTime
- Katip.Core: itemApp :: forall a_aeH9. Lens' (Item a_aeH9) Namespace
+ Katip.Core: itemApp :: forall a_aeHF. Lens' (Item a_aeHF) Namespace
- Katip.Core: itemEnv :: forall a_aeH9. Lens' (Item a_aeH9) Environment
+ Katip.Core: itemEnv :: forall a_aeHF. Lens' (Item a_aeHF) Environment
- Katip.Core: itemHost :: forall a_aeH9. Lens' (Item a_aeH9) HostName
+ Katip.Core: itemHost :: forall a_aeHF. Lens' (Item a_aeHF) HostName
- Katip.Core: itemLoc :: forall a_aeH9. Lens' (Item a_aeH9) (Maybe Loc)
+ Katip.Core: itemLoc :: forall a_aeHF. Lens' (Item a_aeHF) (Maybe Loc)
- Katip.Core: itemMessage :: forall a_aeH9. Lens' (Item a_aeH9) LogStr
+ Katip.Core: itemMessage :: forall a_aeHF. Lens' (Item a_aeHF) LogStr
- Katip.Core: itemNamespace :: forall a_aeH9. Lens' (Item a_aeH9) Namespace
+ Katip.Core: itemNamespace :: forall a_aeHF. Lens' (Item a_aeHF) Namespace
- Katip.Core: itemPayload :: forall a_aeH9 a_al3b. Lens (Item a_aeH9) (Item a_al3b) a_aeH9 a_al3b
+ Katip.Core: itemPayload :: forall a_aeHF a_al3H. Lens (Item a_aeHF) (Item a_al3H) a_aeHF a_al3H
- Katip.Core: itemProcess :: forall a_aeH9. Lens' (Item a_aeH9) ProcessID
+ Katip.Core: itemProcess :: forall a_aeHF. Lens' (Item a_aeHF) ProcessID
- Katip.Core: itemSeverity :: forall a_aeH9. Lens' (Item a_aeH9) Severity
+ Katip.Core: itemSeverity :: forall a_aeHF. Lens' (Item a_aeHF) Severity
- Katip.Core: itemThread :: forall a_aeH9. Lens' (Item a_aeH9) ThreadIdText
+ Katip.Core: itemThread :: forall a_aeHF. Lens' (Item a_aeHF) ThreadIdText
- Katip.Core: itemTime :: forall a_aeH9. Lens' (Item a_aeH9) UTCTime
+ Katip.Core: itemTime :: forall a_aeHF. Lens' (Item a_aeHF) UTCTime
Files
- changelog.md +4/−0
- katip.cabal +1/−1
- src/Katip.hs +1/−1
- src/Katip/Core.hs +9/−0
- src/Katip/Monadic.hs +8/−0
changelog.md view
@@ -1,3 +1,7 @@+0.8.2.0+=======+* Add `MonadFail` instances for `base` >= 4.9.0.0 [Koray Al](https://github.com/korayal)+ 0.8.1.0 ======= * Export `logLoc`. Credit to [Brian McKenna](https://github.com/puffnfresh)
katip.cabal view
@@ -1,5 +1,5 @@ name: katip-version: 0.8.1.0+version: 0.8.2.0 synopsis: A structured logging framework. description: Katip is a structured logging framework. See README.md for more details.
src/Katip.hs view
@@ -44,7 +44,7 @@ -- -- newtype App m a = App { -- unApp :: ReaderT Config m a--- } deriving (Functor, Applicative, Monad) -- more instances as needed+-- } deriving (Functor, Applicative, Monad, MonadIO, MonadReader Config) -- these are necessary -- -- -- -- These instances get even easier with lenses!
src/Katip/Core.hs view
@@ -31,6 +31,9 @@ import Control.Exception.Safe import Control.Monad (unless, void, when) import Control.Monad.Base+#if MIN_VERSION_base(4, 9, 0)+import qualified Control.Monad.Fail as MF+#endif import Control.Monad.IO.Class import Control.Monad.IO.Unlift import Control.Monad.Trans.Class@@ -901,6 +904,12 @@ askUnliftIO = KatipT $ withUnliftIO $ \u -> pure (UnliftIO (unliftIO u . unKatipT))++#if MIN_VERSION_base(4, 9, 0)+instance MF.MonadFail m => MF.MonadFail (KatipT m) where+ fail msg = lift (MF.fail msg)+ {-# INLINE fail #-}+#endif ------------------------------------------------------------------------------- -- | Execute 'KatipT' on a log env.
src/Katip/Monadic.hs view
@@ -44,6 +44,9 @@ import Control.Exception.Safe import Control.Monad.Base import Control.Monad.Error.Class+#if MIN_VERSION_base(4, 9, 0)+import qualified Control.Monad.Fail as MF+#endif import Control.Monad.IO.Class import Control.Monad.IO.Unlift import Control.Monad.Reader@@ -396,6 +399,11 @@ withUnliftIO $ \u -> pure (UnliftIO (unliftIO u . unKatipContextT)) +#if MIN_VERSION_base(4, 9, 0)+instance MF.MonadFail m => MF.MonadFail (KatipContextT m) where+ fail msg = lift (MF.fail msg)+ {-# INLINE fail #-}+#endif ------------------------------------------------------------------------------- runKatipContextT :: (LogItem c) => LogEnv -> c -> Namespace -> KatipContextT m a -> m a