Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Blammo.Logging.Setup
Synopsis
- class HasLogger env where
- withLogger :: MonadUnliftIO m => LogSettings -> (Logger -> m a) -> m a
- newLogger :: MonadIO m => LogSettings -> m Logger
- runLoggerLoggingT :: (MonadUnliftIO m, HasLogger env) => env -> LoggingT m a -> m a
- data LoggingT (m :: Type -> Type) a
- newtype WithLogger env m a = WithLogger (ReaderT env m a)
- runWithLogger :: env -> WithLogger env m a -> m a
- newLoggerEnv :: MonadIO m => m Logger
- withLoggerEnv :: MonadUnliftIO m => (Logger -> m a) -> m a
- runSimpleLoggingT :: MonadUnliftIO m => LoggingT m a -> m a
Documentation
withLogger :: MonadUnliftIO m => LogSettings -> (Logger -> m a) -> m a Source #
Initialize logging, pass a Logger
to the callback, and clean up at the end
Applications should avoid calling this more than once in their lifecycle.
runLoggerLoggingT :: (MonadUnliftIO m, HasLogger env) => env -> LoggingT m a -> m a Source #
Initialize logging, pass a Logger
to the callback, and clean up at the end
Applications should avoid calling this more than once in their lifecycle.
data LoggingT (m :: Type -> Type) a #
Monad transformer that adds a new logging function.
Since: monad-logger-0.2.2
Instances
newtype WithLogger env m a Source #
Useful with the DerivingVia
language extension to derive
MonadLogger
for your application monad
Constructors
WithLogger (ReaderT env m a) |
Instances
runWithLogger :: env -> WithLogger env m a -> m a Source #
newLoggerEnv :: MonadIO m => m Logger Source #
Construct a Logger
configured via environment variables
withLoggerEnv :: MonadUnliftIO m => (Logger -> m a) -> m a Source #
Initialize logging (configured via environment variables),
pass a Logger
to the callback, and clean up at the end
Applications should avoid calling this more than once in their lifecycle.
runSimpleLoggingT :: MonadUnliftIO m => LoggingT m a -> m a Source #
Construct a Logger
configured via environment variables and use it