| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Control.Eff.Log.MessageRenderer
Description
Rendering functions for LogMessages.
Synopsis
- type LogMessageRenderer a = LogMessage -> a
- renderLogMessageSyslog :: LogMessageRenderer Text
- renderLogMessageConsoleLog :: LogMessageRenderer Text
- renderRFC3164 :: LogMessageRenderer Text
- renderRFC3164WithRFC5424Timestamps :: LogMessageRenderer Text
- renderRFC3164WithTimestamp :: LogMessageTimeRenderer -> LogMessageRenderer Text
- renderRFC5424 :: LogMessageRenderer Text
- renderRFC5424Header :: LogMessageRenderer Text
- renderRFC5424NoLocation :: LogMessageRenderer Text
- renderSyslogSeverityAndFacility :: LogMessageRenderer Text
- renderLogMessageSrcLoc :: LogMessageRenderer (Maybe Text)
- renderMaybeLogMessageLens :: Text -> Getter LogMessage (Maybe Text) -> LogMessageRenderer Text
- renderLogMessageBodyNoLocation :: LogMessageRenderer Text
- renderLogMessageBody :: LogMessageRenderer Text
- renderLogMessageBodyFixWidth :: LogMessageRenderer Text
- data LogMessageTimeRenderer
- mkLogMessageTimeRenderer :: String -> LogMessageTimeRenderer
- suppressTimestamp :: LogMessageTimeRenderer
- rfc3164Timestamp :: LogMessageTimeRenderer
- rfc5424Timestamp :: LogMessageTimeRenderer
- rfc5424NoZTimestamp :: LogMessageTimeRenderer
Log Message Text Rendering
type LogMessageRenderer a = LogMessage -> a Source #
LogMessage rendering function
renderLogMessageSyslog :: LogMessageRenderer Text Source #
Render the LogMessage to contain the severity, message, message-id, pid.
Omit hostname, PID and timestamp.
Render the header using renderSyslogSeverity
Useful for logging to devlog
renderLogMessageConsoleLog :: LogMessageRenderer Text Source #
Render a LogMessage human readable, for console logging
renderRFC3164 :: LogMessageRenderer Text Source #
Render a LogMessage according to the rules in the RFC-3164.
renderRFC3164WithRFC5424Timestamps :: LogMessageRenderer Text Source #
Render a LogMessage according to the rules in the RFC-3164 but use
RFC5424 time stamps.
renderRFC3164WithTimestamp :: LogMessageTimeRenderer -> LogMessageRenderer Text Source #
Render a LogMessage according to the rules in the RFC-3164 but use the custom
LogMessageTimeRenderer.
renderRFC5424 :: LogMessageRenderer Text Source #
Render a LogMessage according to the rules in the RFC-5424.
Equivalent to .renderRFC5424Header <> const " " <> renderLogMessageBody
Since: 0.21.0
renderRFC5424Header :: LogMessageRenderer Text Source #
Render the header and strucuted data of a LogMessage according to the rules in the RFC-5424, but do not
render the lmMessage.
Since: 0.22.0
renderRFC5424NoLocation :: LogMessageRenderer Text Source #
Render a LogMessage according to the rules in the RFC-5424, like renderRFC5424 but
suppress the source location information.
Equivalent to .renderRFC5424Header <> const " " <> renderLogMessageBodyNoLocation
Since: 0.21.0
Partial Log Message Text Rendering
renderSyslogSeverityAndFacility :: LogMessageRenderer Text Source #
Render the severity and facility as described in RFC-3164
Render e.g. as <192>.
Useful as header for syslog compatible log output.
renderLogMessageSrcLoc :: LogMessageRenderer (Maybe Text) Source #
Render the source location as: at filepath:linenumber.
renderMaybeLogMessageLens :: Text -> Getter LogMessage (Maybe Text) -> LogMessageRenderer Text Source #
Render a field of a LogMessage using the corresponsing lens.
renderLogMessageBodyNoLocation :: LogMessageRenderer Text Source #
Print the thread id, the message and the source file location, seperated by simple white space.
renderLogMessageBody :: LogMessageRenderer Text Source #
Print the thread id, the message and the source file location, seperated by simple white space.
renderLogMessageBodyFixWidth :: LogMessageRenderer Text Source #
Print the body of a LogMessage with fix size fields (60) for the message itself
and 30 characters for the location
Timestamp Rendering
data LogMessageTimeRenderer Source #
A rendering function for the lmTimestamp field.
mkLogMessageTimeRenderer Source #
Arguments
| :: String | The format string that is passed to |
| -> LogMessageTimeRenderer |
Make a LogMessageTimeRenderer using formatTime in the defaultLocale.
suppressTimestamp :: LogMessageTimeRenderer Source #
Don't render the time stamp
rfc3164Timestamp :: LogMessageTimeRenderer Source #
Render the time stamp using "%h %d %H:%M:%S"
rfc5424Timestamp :: LogMessageTimeRenderer Source #
Render the time stamp to iso8601DateFormat (Just "%H:%M:%S%6QZ")
rfc5424NoZTimestamp :: LogMessageTimeRenderer Source #
Render the time stamp like rfc5424Timestamp does, but omit the terminal Z character.