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