canteven-log- A canteven way of setting up logging for your program.

Safe HaskellNone




cantevenLogFormat :: Loc -> LogSource -> LogLevel -> LogStr -> ZonedTime -> ThreadId -> LogStr Source

This log format is inspired by syslog and the log formats. Rationales are:

  • Put the date first, because the date string tends to be a fixed number of characters (or +/- 1 around changes to DST), so the eye can easily skim over them.
  • The "source" of a message comes before the message itself. Source is composed of not just the "logger name" (called a source in monad-logger), but also the package/module name and the thread ID. Package and module name might seem controversial, but they correspond to e.g. Log4J logger names based on classes.
  • Filename/position of the message is perhaps the least important, but can still be helpful. Put it at the end.

getRunCantevenLoggingT :: (Functor io1, MonadIO io1, MonadIO io2) => io1 (LoggingT io2 a -> io2 a) Source

Get the logging config using canteven, and produce a way to use that logging config to run a LoggingT.

runCantevenLoggingDefaultT :: MonadIO io => LoggingT io a -> io a Source

Run a LoggingT, using the canteven logging format, with the default logging configuration.