| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Control.Eff.LogWriter.Rich
Description
Enrich LogMessages with timestamps and OS dependent information.
Synopsis
- richLogWriter :: Text -> Facility -> LogWriter -> LogWriter
- withRichLogging :: Lifted IO e => LogWriter -> Text -> Facility -> LogPredicate -> Eff (Logs ': (LogWriterReader ': e)) a -> Eff e a
- stdoutLogWriter :: LogMessageRenderer Text -> IO LogWriter
Documentation
Arguments
| :: Text | The default application name to put into the |
| -> Facility | The default RFC-5424 facility to put into the |
| -> LogWriter | The IO based writer to decorate |
| -> LogWriter |
Decorate an IO based LogWriter to fill out these fields in LogMessages:
- The messages will carry the given application name in the
lmAppNamefield. - The
lmTimestampfield contains the UTC time of the log event - The
lmHostnamefield contains the FQDN of the current host - The
lmFacilityfield contains the givenFacility
It works by using mappingLogWriterIO.
Arguments
| :: Lifted IO e | |
| => LogWriter | The |
| -> 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 IO using the richLogWriter.
Example:
exampleWithIoLogging :: IO ()
exampleWithIoLogging =
runLift
$ withRichLogging debugTraceLogWriter
"my-app"
local7
(lmSeverityIsAtLeast informationalSeverity)
$ logInfo "Oh, hi there"stdoutLogWriter :: LogMessageRenderer Text -> IO LogWriter Source #
Render a LogMessage to stdout.
This function will also set the BufferMode of stdout to LineBuffering.
See ioHandleLogWriter.
Since: 0.31.0