Safe Haskell | None |
---|---|
Language | Haskell2010 |
This module contains definitions for formatting log message to write it to output.
Log message format is defined by using text-format-heavy
syntax. Variables available are:
level - message severity level. Variable format can be specified in form of
selector[~convert]
, where:selector
isname
for level name,value
for level integer value,syslog
for name of syslog equivalent of the level.convert
isu
for upper case,l
for lower case,t
for title case (all words capitalized).
Default format corresponds to
name
. For example, use{level:~l}
to output level name in lower case.- source - message source (module name)
- location - location from where message was logged (in form of
(line, column)
). - line - source file line number from where message was logged.
- file - source file name from where message was logged.
- package - name of the package from where message was logged.
- time - message time
- message - message string itself
- fullcontext - full set of current context variable values, in
name=value; name=value;
form. - Also all variables from context are available.
Synopsis
- data LogMessageWithTime = LogMessageWithTime FormattedTime LogMessage
- defaultLogFormat :: Format
- formatLogMessage :: Format -> LogMessage -> FormattedTime -> LogStr
- formatLogMessage' :: Format -> LogMessage -> FormattedTime -> Text
Documentation
data LogMessageWithTime Source #
Instances
VarContainer LogMessageWithTime Source # | |
Defined in System.Log.Heavy.Format |
defaultLogFormat :: Format Source #
Default log message format.
Corresponds to: {time} [{level}] {source}: {message}\n
formatLogMessage :: Format -> LogMessage -> FormattedTime -> LogStr Source #
Format log message for output.
formatLogMessage' :: Format -> LogMessage -> FormattedTime -> Text Source #
Format log message for output.