Safe Haskell | None |
---|---|
Language | Haskell2010 |
Rendering functions for LogMessage
s.
Synopsis
- type LogMessageRenderer a = LogMessage -> a
- type LogMessageTextRenderer = LogMessageRenderer Text
- renderLogMessageSyslog :: LogMessageTextRenderer
- renderLogMessageConsoleLog :: LogMessageTextRenderer
- renderConsoleMinimalisticWide :: LogMessageRenderer Text
- renderRFC3164 :: LogMessageTextRenderer
- renderRFC3164WithRFC5424Timestamps :: LogMessageTextRenderer
- renderRFC3164WithTimestamp :: LogMessageTimeRenderer -> LogMessageTextRenderer
- renderRFC5424 :: LogMessageTextRenderer
- renderRFC5424Header :: LogMessageTextRenderer
- renderRFC5424NoLocation :: LogMessageTextRenderer
- renderSyslogSeverityAndFacility :: LogMessageTextRenderer
- renderLogMessageSrcLoc :: LogMessageRenderer (Maybe Text)
- renderMaybeLogMessageLens :: Text -> Getter LogMessage (Maybe Text) -> LogMessageTextRenderer
- renderLogMessageBodyNoLocation :: LogMessageTextRenderer
- renderLogMessageBody :: LogMessageTextRenderer
- renderLogMessageBodyFixWidth :: LogMessageTextRenderer
- 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
type LogMessageTextRenderer = LogMessageRenderer Text Source #
LogMessage
to Text
rendering function.
Since: 0.31.0
renderLogMessageSyslog :: LogMessageTextRenderer 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 :: LogMessageTextRenderer Source #
Render a LogMessage
human readable, for console logging
renderConsoleMinimalisticWide :: LogMessageRenderer Text Source #
Render a LogMessage
human readable, for console logging
Since: 0.31.0
renderRFC3164 :: LogMessageTextRenderer Source #
Render a LogMessage
according to the rules in the RFC-3164.
renderRFC3164WithRFC5424Timestamps :: LogMessageTextRenderer Source #
Render a LogMessage
according to the rules in the RFC-3164 but use
RFC5424 time stamps.
renderRFC3164WithTimestamp :: LogMessageTimeRenderer -> LogMessageTextRenderer Source #
Render a LogMessage
according to the rules in the RFC-3164 but use the custom
LogMessageTimeRenderer
.
renderRFC5424 :: LogMessageTextRenderer Source #
Render a LogMessage
according to the rules in the RFC-5424.
Equivalent to
.renderRFC5424Header
<> const " " <> renderLogMessageBody
Since: 0.21.0
renderRFC5424Header :: LogMessageTextRenderer 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 :: LogMessageTextRenderer 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 :: LogMessageTextRenderer 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) -> LogMessageTextRenderer Source #
Render a field of a LogMessage
using the corresponsing lens.
renderLogMessageBodyNoLocation :: LogMessageTextRenderer Source #
Print the thread id, the message and the source file location, seperated by simple white space.
renderLogMessageBody :: LogMessageTextRenderer Source #
Print the thread id, the message and the source file location, seperated by simple white space.
renderLogMessageBodyFixWidth :: LogMessageTextRenderer 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 #
:: 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.