Safe Haskell | None |
---|---|
Language | Haskell2010 |
This helps to setup logging to standard ouput.
Synopsis
- withConsoleLogWriter :: IoLogging e => Eff e a -> Eff e a
- withConsoleLogging :: Lifted IO e => Text -> Facility -> LogPredicate -> Eff (Logs ': (LogWriterReader ': e)) a -> Eff e a
- consoleLogWriter :: IO LogWriter
Documentation
withConsoleLogWriter :: IoLogging e => Eff e a -> Eff e a Source #
Enable logging to standard output
using the consoleLogWriter
.
Log messages are rendered using renderLogMessageConsoleLog
.
Example:
exampleWithConsoleLogWriter :: IO () exampleWithConsoleLogWriter = runLift $ withoutLogging @IO $ withConsoleLogWriter $ logInfo "Oh, hi there"
:: Lifted IO e | |
=> Text | The default application name to put into the |
-> Facility | The default RFC-5424 facility to put into the |
-> LogPredicate | The inital predicate for log messages, there are some pre-defined in Control.Eff.Log.Message |
-> Eff (Logs ': (LogWriterReader ': e)) a | |
-> Eff e a |
Enable logging to standard output
using the consoleLogWriter
, with some LogMessage
fields preset
as in withRichLogging
.
Log messages are rendered using renderLogMessageConsoleLog
.
Example:
exampleWithConsoleLogging :: IO () exampleWithConsoleLogging = runLift $ withConsoleLogging "my-app" local7 allLogMessages $ logInfo "Oh, hi there"
To vary the LogWriter
use withRichLogging
.