log-warper-1.8.1: Flexible, configurable, monadic and pretty logging

Safe HaskellNone
LanguageHaskell2010

System.Wlog.HasLoggerName

Contents

Description

This module contains type class for HasLoggerName.

Synopsis

Remove boilerplater

class HasLoggerName m where Source #

This type class exists to remove boilerplate logging by adding the logger's name to the context in each module.

TODO: replace current methods with Lens?

Methods

askLoggerName :: m LoggerName Source #

Extract logger name from context

modifyLoggerName :: (LoggerName -> LoggerName) -> m a -> m a Source #

Change logger name in context

askLoggerName :: (MonadTrans t, t n ~ m, Monad n, HasLoggerName n) => m LoggerName Source #

Extract logger name from context

modifyLoggerName :: (MFunctor t, t n ~ m, Monad n, HasLoggerName n) => (LoggerName -> LoggerName) -> m a -> m a Source #

Change logger name in context

Instances

HasLoggerName Identity Source # 
Monad m => HasLoggerName (LoggerNameBox m) Source # 
Monad m => HasLoggerName (NamedPureLogger m) Source # 
(HasLoggerName m, Monad m) => HasLoggerName (PureLogger m) Source # 
(Monoid w, Monad m, HasLoggerName m) => HasLoggerName (WriterT w m) Source # 
(Monad m, HasLoggerName m) => HasLoggerName (StateT a m) Source # 
(Monad m, HasLoggerName m) => HasLoggerName (StateT a m) Source # 
(Monad m, HasLoggerName m) => HasLoggerName (ExceptT e m) Source # 
(Monad m, HasLoggerName m) => HasLoggerName (ReaderT * a m) Source # 
(Monad m, HasLoggerName m) => HasLoggerName (ContT * r m) Source # 
(Monad m, HasLoggerName m, Monoid w) => HasLoggerName (RWST r w s m) Source # 

Methods

askLoggerName :: RWST r w s m LoggerName Source #

modifyLoggerName :: (LoggerName -> LoggerName) -> RWST r w s m a -> RWST r w s m a Source #

(Monad m, HasLoggerName m, Monoid w) => HasLoggerName (RWST r w s m) Source # 

Methods

askLoggerName :: RWST r w s m LoggerName Source #

modifyLoggerName :: (LoggerName -> LoggerName) -> RWST r w s m a -> RWST r w s m a Source #

setLoggerName :: HasLoggerName m => LoggerName -> m a -> m a Source #

Set logger name in context.

withSublogger :: HasLoggerName m => LoggerName -> m a -> m a Source #

Change logger name to the given one