logsink-0.2.0: A logging framework for Haskell

Safe HaskellSafe
LanguageHaskell2010

System.Logging.LogSink.Format

Synopsis

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 LogLevel of 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 ThreadId of the logging thread.

For example, "{timestamp} {level}: {message}" would be a valid format string.

When given an invalid format strings, parseFormat returns Left.