simple-log-0.9.3: Simple log for Haskell

Safe HaskellNone
LanguageHaskell2010

System.Log.Simple.Monad

Synopsis

Documentation

Monad log

class (MonadIO m, MonadMask m) => MonadLog m where Source #

Minimal complete definition

askLog, localLog

Methods

askLog :: m Log Source #

localLog :: (Log -> Log) -> m a -> m a Source #

Instances

(MonadLog m, MonadTrans t, MFunctor * t, MonadIO (t m), MonadMask (t m)) => MonadLog (t m) Source # 

Methods

askLog :: t m Log Source #

localLog :: (Log -> Log) -> t m a -> t m a Source #

(MonadIO m, MonadMask m) => MonadLog (LogT m) Source # 

Methods

askLog :: LogT m Log Source #

localLog :: (Log -> Log) -> LogT m a -> LogT m a Source #

newtype LogT m a Source #

Constructors

LogT 

Fields

Instances

MonadTrans LogT Source # 

Methods

lift :: Monad m => m a -> LogT m a #

Monad m => MonadReader Log (LogT m) Source # 

Methods

ask :: LogT m Log #

local :: (Log -> Log) -> LogT m a -> LogT m a #

reader :: (Log -> a) -> LogT m a #

Monad m => Monad (LogT m) Source # 

Methods

(>>=) :: LogT m a -> (a -> LogT m b) -> LogT m b #

(>>) :: LogT m a -> LogT m b -> LogT m b #

return :: a -> LogT m a #

fail :: String -> LogT m a #

Functor m => Functor (LogT m) Source # 

Methods

fmap :: (a -> b) -> LogT m a -> LogT m b #

(<$) :: a -> LogT m b -> LogT m a #

Applicative m => Applicative (LogT m) Source # 

Methods

pure :: a -> LogT m a #

(<*>) :: LogT m (a -> b) -> LogT m a -> LogT m b #

(*>) :: LogT m a -> LogT m b -> LogT m b #

(<*) :: LogT m a -> LogT m b -> LogT m a #

MonadIO m => MonadIO (LogT m) Source # 

Methods

liftIO :: IO a -> LogT m a #

MonadThrow m => MonadThrow (LogT m) Source # 

Methods

throwM :: Exception e => e -> LogT m a #

MonadCatch m => MonadCatch (LogT m) Source # 

Methods

catch :: Exception e => LogT m a -> (e -> LogT m a) -> LogT m a #

MonadMask m => MonadMask (LogT m) Source # 

Methods

mask :: ((forall a. LogT m a -> LogT m a) -> LogT m b) -> LogT m b #

uninterruptibleMask :: ((forall a. LogT m a -> LogT m a) -> LogT m b) -> LogT m b #

(MonadIO m, MonadMask m) => MonadLog (LogT m) Source # 

Methods

askLog :: LogT m Log Source #

localLog :: (Log -> Log) -> LogT m a -> LogT m a Source #

noLog :: (MonadIO m, MonadMask m) => LogT m a -> m a Source #

Run with no logging

withLog :: Log -> LogT m a -> m a Source #

Run LogT monad with Log

runLog :: (MonadIO m, MonadMask m) => LogConfig -> [LogHandler] -> LogT m a -> m a Source #

Run LogT monad with log config and handlers

Getters

askComponent :: MonadLog m => m Component Source #

Ask current component

askScope :: MonadLog m => m Scope Source #

Ask current scope

Log functions

log :: MonadLog m => Level -> Text -> m () Source #

Log message

sendLog :: MonadLog m => Level -> Text -> m () Source #

Log message, same as log

component :: MonadLog m => Text -> m a -> m a Source #

Log component, also sets root scope

scope_ :: MonadLog m => Text -> m a -> m a Source #

Create local scope

scope :: MonadLog m => Text -> m a -> m a Source #

Scope with log all exceptions

scopeM :: (MonadLog m, MonadError e m, Show e) => Text -> m a -> m a Source #

Scope with log exception from MonadError

scoper :: (MonadLog m, Show a) => Text -> m a -> m a Source #

Scope with tracing result

scoperM :: (MonadLog m, MonadError e m, Show e, Show a) => Text -> m a -> m a Source #

trace :: (MonadLog m, Show a) => Text -> m a -> m a Source #

Trace value

modifyLogConfig :: MonadLog m => (LogConfig -> LogConfig) -> m LogConfig Source #

Modify config, same as updateLogConfig, but within MonadLog

modifyLogHandlers :: MonadLog m => ([LogHandler] -> [LogHandler]) -> m () Source #

Modify handlers, same as updateLogHandlers, but within MonadLog