ganeti

Safe HaskellSafe-Infered

Ganeti.Logging.WriterLog

Contents

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 LogSeqSource

newtype WriterLogT m a Source

A monad transformer that adds pure logging capability.

Constructors

WriterLogT 

Instances

MonadTrans WriterLogT 
MonadTransControl WriterLogT 
MonadBase IO m => MonadBase IO (WriterLogT m) 
MonadBaseControl IO m => MonadBaseControl IO (WriterLogT m) 
Monad m => Monad (WriterLogT m) 
Monad m => Functor (WriterLogT m) 
MonadPlus m => MonadPlus (WriterLogT m) 
Monad m => Applicative (WriterLogT m) 
MonadPlus m => Alternative (WriterLogT m) 
MonadIO m => MonadIO (WriterLogT m) 
Monad m => MonadLog (WriterLogT m) 

type WriterLog = WriterLogT IdentitySource

execWriterLogT :: MonadLog m => WriterLogT m a -> m aSource

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 aSource

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