| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Control.Eff.LogWriter.DebugTrace
Description
This helps to setup logging via Debug.Trace.
Synopsis
- withTraceLogWriter :: IoLogging e => Eff e a -> Eff e a
- withTraceLogging :: Lifted IO e => Text -> Facility -> LogPredicate -> Eff (Logs ': (LogWriterReader ': e)) a -> Eff e a
- debugTraceLogWriter :: LogMessageTextRenderer -> LogWriter
Documentation
withTraceLogWriter :: IoLogging e => Eff e a -> Eff e a Source #
Enable logging via traceM using the debugTraceLogWriter. The
logging monad type can be any type with a Monad instance.
Log messages are rendered using renderLogMessageConsoleLog.
Example:
exampleWithTraceLogWriter :: IO ()
exampleWithTraceLogWriter =
runLift
$ withoutLogging @IO
$ withTraceLogWriter
$ logInfo "Oh, hi there"Arguments
| :: 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 via traceM using the debugTraceLogWriter, with some LogMessage fields preset
as in withRichLogging.
Log messages are rendered using renderLogMessageConsoleLog.
Example:
exampleWithTraceLogging :: IO ()
exampleWithTraceLogging =
runLift
$ withTraceLogging "my-app" local7 allLogMessages
$ logInfo "Oh, hi there"debugTraceLogWriter :: LogMessageTextRenderer -> LogWriter Source #
Write LogMessages via traceM.