| Safe Haskell | Safe |
|---|---|
| Language | Haskell2010 |
System.Logging.LogSink.Format
- parseFormat :: String -> Either String Format
Documentation
parseFormat :: String -> Either String Format Source #
Parses a format string into a Format function.
It's possible to include information about the log record and the context in which logging happened into the formatted message. The following variables can be interpolated by enclosing them in curly braces:
- level
- The
LogLevelof the log record. - message
- The actual log message of the log record.
- timestamp
- The time at which the log record is consumed.
- thread-id
- The
ThreadIdof the logging thread.
For example, "{timestamp} {level}: {message}" would be a valid format
string.
When given an invalid format strings, parseFormat returns Left.