yesod-katip-0.1.0.0: Logging bridge between Yesod and Katip
Copyright(c) Isaac van Bakel 2020
LicenseBSD3
Maintainerivb@vanbakel.io
Stabilityexperimental
PortabilityPOSIX
Safe HaskellNone
LanguageHaskell2010

Yesod.Katip.Class

Description

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

Documentation

class SiteKatip site where Source #

A class for sites which provide a Katip-equivalent API

Methods

getLogEnv :: MonadSite m => m site LogEnv Source #

localLogEnv :: MonadSite m => (LogEnv -> LogEnv) -> m site a -> m site a Source #

Instances

Instances details
(SiteTrans t, SiteKatip site) => SiteKatip (t site) Source # 
Instance details

Defined in Yesod.Katip.Class

Methods

getLogEnv :: MonadSite m => m (t site) LogEnv Source #

localLogEnv :: MonadSite m => (LogEnv -> LogEnv) -> m (t site) a -> m (t site) a Source #

SiteKatip (KatipSite site) Source # 
Instance details

Defined in Yesod.Katip

Methods

getLogEnv :: MonadSite m => m (KatipSite site) LogEnv Source #

localLogEnv :: MonadSite m => (LogEnv -> LogEnv) -> m (KatipSite site) a -> m (KatipSite site) a Source #

SiteKatip (KatipContextSite site) Source # 
Instance details

Defined in Yesod.Katip

class SiteKatip site => SiteKatipContext site where Source #

A class for sites which provide a KatipContext-equivalent API

Methods

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

Instances details
(SiteTrans t, SiteKatipContext site) => SiteKatipContext (t site) Source # 
Instance details

Defined in Yesod.Katip.Class

Methods

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 # 
Instance details

Defined in Yesod.Katip

Orphan instances

(MonadSite m, SiteKatipContext site) => KatipContext (m site) Source # 
Instance details

Methods

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 # 
Instance details

Methods

getLogEnv :: m site LogEnv #

localLogEnv :: (LogEnv -> LogEnv) -> m site a -> m site a #