ganeti
Safe HaskellNone

Ganeti.Logging.WriterLog

Description

A pure implementation of MonadLog using MonadWriter

Synopsis

The data type of the monad transformer

type LogSeq = Seq (Priority, String) Source #

type WriterSeq = WriterT LogSeq Source #

newtype WriterLogT m a Source #

A monad transformer that adds pure logging capability.

Constructors

WriterLogT 

Instances

Instances details
MonadTrans WriterLogT # 
Instance details

Defined in Ganeti.Logging.WriterLog

Methods

lift :: Monad m => m a -> WriterLogT m a

MonadTransControl WriterLogT # 
Instance details

Defined in Ganeti.Logging.WriterLog

Associated Types

type StT WriterLogT a

Methods

liftWith :: Monad m => (Run WriterLogT -> m a) -> WriterLogT m a

restoreT :: Monad m => m (StT WriterLogT a) -> WriterLogT m a

MonadBase IO m => MonadBase IO (WriterLogT m) # 
Instance details

Defined in Ganeti.Logging.WriterLog

Methods

liftBase :: IO α -> WriterLogT m α

MonadBaseControl IO m => MonadBaseControl IO (WriterLogT m) # 
Instance details

Defined in Ganeti.Logging.WriterLog

Associated Types

type StM (WriterLogT m) a

Methods

liftBaseWith :: (RunInBase (WriterLogT m) IO -> IO a) -> WriterLogT m a

restoreM :: StM (WriterLogT m) a -> WriterLogT m a

Monad m => Monad (WriterLogT m) # 
Instance details

Defined in Ganeti.Logging.WriterLog

Methods

(>>=) :: WriterLogT m a -> (a -> WriterLogT m b) -> WriterLogT m b

(>>) :: WriterLogT m a -> WriterLogT m b -> WriterLogT m b

return :: a -> WriterLogT m a

Functor m => Functor (WriterLogT m) # 
Instance details

Defined in Ganeti.Logging.WriterLog

Methods

fmap :: (a -> b) -> WriterLogT m a -> WriterLogT m b

(<$) :: a -> WriterLogT m b -> WriterLogT m a

Applicative m => Applicative (WriterLogT m) # 
Instance details

Defined in Ganeti.Logging.WriterLog

Methods

pure :: a -> WriterLogT m a

(<*>) :: WriterLogT m (a -> b) -> WriterLogT m a -> WriterLogT m b

liftA2 :: (a -> b -> c) -> WriterLogT m a -> WriterLogT m b -> WriterLogT m c

(*>) :: WriterLogT m a -> WriterLogT m b -> WriterLogT m b

(<*) :: WriterLogT m a -> WriterLogT m b -> WriterLogT m a

Alternative m => Alternative (WriterLogT m) # 
Instance details

Defined in Ganeti.Logging.WriterLog

Methods

empty :: WriterLogT m a

(<|>) :: WriterLogT m a -> WriterLogT m a -> WriterLogT m a

some :: WriterLogT m a -> WriterLogT m [a]

many :: WriterLogT m a -> WriterLogT m [a]

MonadPlus m => MonadPlus (WriterLogT m) # 
Instance details

Defined in Ganeti.Logging.WriterLog

Methods

mzero :: WriterLogT m a

mplus :: WriterLogT m a -> WriterLogT m a -> WriterLogT m a

MonadIO m => MonadIO (WriterLogT m) # 
Instance details

Defined in Ganeti.Logging.WriterLog

Methods

liftIO :: IO a -> WriterLogT m a

Monad m => MonadLog (WriterLogT m) # 
Instance details

Defined in Ganeti.Logging.WriterLog

Methods

logAt :: Priority -> String -> WriterLogT m () Source #

type StT WriterLogT a # 
Instance details

Defined in Ganeti.Logging.WriterLog

type StT WriterLogT a
type StM (WriterLogT m) a # 
Instance details

Defined in Ganeti.Logging.WriterLog

type StM (WriterLogT m) a = ComposeSt WriterLogT m a

type WriterLog = WriterLogT Identity Source #

execWriterLogT :: MonadLog m => WriterLogT m a -> m a Source #

Runs a WriterLogT, and when it finishes, resends all log messages to the underlying monad that implements MonadLog.

This can be used to delay logging messages, by accumulating them in WriterLogT, and resending them at the end to the underlying monad.

dumpLogSeq :: MonadLog m => LogSeq -> m () Source #

Sends all log messages to the a monad that implements MonadLog.

execWriterLog :: MonadLog m => WriterLog a -> m a Source #

Runs a WriterLog, and when it finishes, resends all log messages to the a monad that implements MonadLog.