Safe Haskell | None |
---|---|
Language | Haskell2010 |
This module contains type classes for loggers that have LoggerName
.
- class HasLoggerName m where
- newtype LoggerNameBox m a = LoggerNameBox {
- loggerNameBoxEntry :: ReaderT LoggerName m a
- setLoggerName :: HasLoggerName m => LoggerName -> m a -> m a
- usingLoggerName :: LoggerName -> LoggerNameBox m a -> m a
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?
getLoggerName :: m LoggerName Source #
Extract logger name from context
modifyLoggerName :: (LoggerName -> LoggerName) -> m a -> m a Source #
Change logger name in context
Monad m => HasLoggerName (LoggerNameBox 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 (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 # | |
(Monad m, HasLoggerName m, Monoid w) => HasLoggerName (RWST r w s m) Source # | |
newtype LoggerNameBox m a Source #
Default implementation of WithNamedLogger
.
MonadTrans LoggerNameBox Source # | |
MonadState s m => MonadState s (LoggerNameBox m) Source # | |
MonadReader r m => MonadReader r (LoggerNameBox m) Source # | |
MonadBase b m => MonadBase b (LoggerNameBox m) Source # | |
MonadBaseControl b m => MonadBaseControl b (LoggerNameBox m) Source # | |
Monad m => Monad (LoggerNameBox m) Source # | |
Functor m => Functor (LoggerNameBox m) Source # | |
MonadFix m => MonadFix (LoggerNameBox m) Source # | |
Applicative m => Applicative (LoggerNameBox m) Source # | |
MonadIO m => MonadIO (LoggerNameBox m) Source # | |
MonadThrow m => MonadThrow (LoggerNameBox m) Source # | |
MonadCatch m => MonadCatch (LoggerNameBox m) Source # | |
MonadMask m => MonadMask (LoggerNameBox m) Source # | |
Monad m => HasLoggerName (LoggerNameBox m) Source # | |
CanLog m => CanLog (LoggerNameBox m) Source # | |
type StM (LoggerNameBox m) a Source # | |
setLoggerName :: HasLoggerName m => LoggerName -> m a -> m a Source #
Set logger name in context.
usingLoggerName :: LoggerName -> LoggerNameBox m a -> m a Source #
Runs a LoggerNameBox
with specified initial LoggerName
.