Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Logging functions
Synopsis
- type LogExecWithContext = forall m. MonadIO m => LogContext -> LogExec m
- type LogExec m = forall a. LoggingT m a -> m a
- type LogContext = LogSource -> LogLevel -> Bool
- type LogLevel = LogLevel
- initLogContext :: IO LogContext
- runDefaultLogExecWithContext :: LogExecWithContext
- stdoutLoggingExec :: LogExecWithContext
- stdoutLoggingContext :: LogContext -> IO LogContext
- stderrLoggingExec :: LogExecWithContext
- stderrLoggingContext :: LogContext -> IO LogContext
- runNullLogExec :: LogExecWithContext
- nullLogger :: Loc -> LogSource -> LogLevel -> LogStr -> IO ()
- _log :: (MonadIO m, MonadLogger m) => Text -> LogLevel -> Text -> m ()
- logExceptions :: (MonadLogger m, MonadCatch m, MonadIO m) => Text -> m a -> m a
- levelInfo :: LogLevel
- levelError :: LogLevel
- levelDebug :: LogLevel
- minLevelFilter :: LogLevel -> LogSource -> LogLevel -> Bool
- infoLevelFilter :: LogSource -> LogLevel -> Bool
Type Aliases (for compatibility)
type LogExecWithContext = forall m. MonadIO m => LogContext -> LogExec m Source #
Runs a monad-logger block with the filter predicate
default logger
initLogContext :: IO LogContext Source #
the default log environment
runDefaultLogExecWithContext :: LogExecWithContext Source #
Runs a monad-logger block with the filter predicate
stdout logger
stdoutLoggingExec :: LogExecWithContext Source #
Runs a monad-logger block targeting stdout, with the filter predicate
stdoutLoggingContext :: LogContext -> IO LogContext Source #
pure
stderr logger
stderrLoggingExec :: LogExecWithContext Source #
Runs a monad-logger block targeting stderr, with the filter predicate
stderrLoggingContext :: LogContext -> IO LogContext Source #
pure
Null logger
runNullLogExec :: LogExecWithContext Source #
Disables monad-logger logging
nullLogger :: Loc -> LogSource -> LogLevel -> LogStr -> IO () Source #
monad-logger which does nothing
Log Msg
_log :: (MonadIO m, MonadLogger m) => Text -> LogLevel -> Text -> m () Source #
Log a message using the current time
Log Exceptions
logExceptions :: (MonadLogger m, MonadCatch m, MonadIO m) => Text -> m a -> m a Source #
re-throws exceptions after logging them