heavy-logger-0.1.0.0: Full-weight logging based on fast-logger

Safe HaskellNone
LanguageHaskell2010

System.Log.Heavy

Contents

Description

This is the main module of heavy-logger package. You usually need to import only this module. All generally required modules are re-exported.

For simple usage cases, you may also want to import System.Log.Heavy.Shortcuts module.

Example of usage is:

 import System.Log.Heavy
 import Data.Text.Format.Heavy
 ...

 withLogging backend id $ do liftIO $ putStr "Your name? "
     liftIO $ hFlush stdout
     name <- liftIO $ getLine
     logMessage $ infoMessage "name was {}" (Single name)
     liftIO $ putStrLn $ "Hello, " ++ name

See also Test.hs.

Synopsis

Reexports

withLogging Source #

Arguments

:: MonadIO m 
=> LogBackend

Logging backend settings

-> (m a -> IO a)

Runner to run m within IO. For example this may be runReader or evalState. Use id for case when m is IO.

-> LoggingT m a

Actions within LoggingT monad.

-> m a 

Run LoggingT monad within some kind of IO monad.