Safe Haskell | None |
---|---|
Language | Haskell2010 |
- type LoggerTImpl = Loc -> LogSource -> LogLevel -> LogStr -> IO ()
- cantevenLogFormat :: Loc -> LogSource -> LogLevel -> LogStr -> ZonedTime -> ThreadId -> LogStr
- getRunCantevenLoggingT :: (Functor io1, MonadIO io1, MonadIO io2) => io1 (LoggingT io2 a -> io2 a)
- getCantevenOutput :: (Functor io, MonadIO io) => io LoggerTImpl
- runCantevenLoggingDefaultT :: MonadIO io => LoggingT io a -> io a
Documentation
cantevenLogFormat :: Loc -> LogSource -> LogLevel -> LogStr -> ZonedTime -> ThreadId -> LogStr Source #
This log format is inspired by syslog and the X.org 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.
getCantevenOutput :: (Functor io, MonadIO io) => io LoggerTImpl Source #
runCantevenLoggingDefaultT :: MonadIO io => LoggingT io a -> io a Source #
Run a LoggingT, using the canteven logging format, with the default logging configuration.