Copyright | (c) Isaac van Bakel 2020 |
---|---|
License | BSD3 |
Maintainer | ivb@vanbakel.io |
Stability | experimental |
Portability | POSIX |
Safe Haskell | None |
Language | Haskell2010 |
This module defines the classes associated with the site transformers KatipSite
and KatipContextSite
.
It also includes instances for Katip
and KatipContext
(the Katip classes)
which let you invoke the Katip logging APIs in your handlers, provided the site
itself satisfies the SiteKatip
or SiteKatipContext
class respectively.
By default, you won't need to use any of these APIs directly. While the classes defined here have APIs identical to their Katip counterparts, it's always better to rely on the Katip APIs.
Synopsis
- class SiteKatip site where
- class SiteKatip site => SiteKatipContext site where
- getKatipContext :: MonadSite m => m site LogContexts
- localKatipContext :: MonadSite m => (LogContexts -> LogContexts) -> m site a -> m site a
- getKatipNamespace :: MonadSite m => m site Namespace
- localKatipNamespace :: MonadSite m => (Namespace -> Namespace) -> m site a -> m site a
Documentation
class SiteKatip site where Source #
A class for sites which provide a Katip
-equivalent API
getLogEnv :: MonadSite m => m site LogEnv Source #
localLogEnv :: MonadSite m => (LogEnv -> LogEnv) -> m site a -> m site a Source #
Instances
(SiteTrans t, SiteKatip site) => SiteKatip (t site) Source # | |
SiteKatip (KatipSite site) Source # | |
SiteKatip (KatipContextSite site) Source # | |
Defined in Yesod.Katip getLogEnv :: MonadSite m => m (KatipContextSite site) LogEnv Source # localLogEnv :: MonadSite m => (LogEnv -> LogEnv) -> m (KatipContextSite site) a -> m (KatipContextSite site) a Source # |
class SiteKatip site => SiteKatipContext site where Source #
A class for sites which provide a KatipContext
-equivalent API
getKatipContext :: MonadSite m => m site LogContexts Source #
localKatipContext :: MonadSite m => (LogContexts -> LogContexts) -> m site a -> m site a Source #
getKatipNamespace :: MonadSite m => m site Namespace Source #
localKatipNamespace :: MonadSite m => (Namespace -> Namespace) -> m site a -> m site a Source #
Instances
(SiteTrans t, SiteKatipContext site) => SiteKatipContext (t site) Source # | |
Defined in Yesod.Katip.Class getKatipContext :: MonadSite m => m (t site) LogContexts Source # localKatipContext :: MonadSite m => (LogContexts -> LogContexts) -> m (t site) a -> m (t site) a Source # getKatipNamespace :: MonadSite m => m (t site) Namespace Source # localKatipNamespace :: MonadSite m => (Namespace -> Namespace) -> m (t site) a -> m (t site) a Source # | |
SiteKatipContext (KatipContextSite site) Source # | |
Defined in Yesod.Katip getKatipContext :: MonadSite m => m (KatipContextSite site) LogContexts Source # localKatipContext :: MonadSite m => (LogContexts -> LogContexts) -> m (KatipContextSite site) a -> m (KatipContextSite site) a Source # getKatipNamespace :: MonadSite m => m (KatipContextSite site) Namespace Source # localKatipNamespace :: MonadSite m => (Namespace -> Namespace) -> m (KatipContextSite site) a -> m (KatipContextSite site) a Source # |
Orphan instances
(MonadSite m, SiteKatipContext site) => KatipContext (m site) Source # | |
getKatipContext :: m site LogContexts # localKatipContext :: (LogContexts -> LogContexts) -> m site a -> m site a # getKatipNamespace :: m site Namespace # localKatipNamespace :: (Namespace -> Namespace) -> m site a -> m site a # | |
(MonadSite m, SiteKatip site) => Katip (m site) Source # | |