Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data LogLevel = LogLevel {}
- errorLevel :: LogLevel
- warnLevel :: LogLevel
- infoLevel :: LogLevel
- debugLevel :: LogLevel
- traceLevel :: LogLevel
- data LogMessage = LogMessage {}
- type LogHandler = LogMessage -> IO ()
- simpleLogHandler :: LogLevel -> LogHandler
- noopLogHandler :: LogHandler
- class Monad m => MonadLogger m where
- logMessage :: LogMessage -> m ()
- logError :: MonadLogger m => Text -> Text -> m ()
- logWarn :: MonadLogger m => Text -> Text -> m ()
- logInfo :: MonadLogger m => Text -> Text -> m ()
- logDebug :: MonadLogger m => Text -> Text -> m ()
- logTrace :: MonadLogger m => Text -> Text -> m ()
- runExceptTOrLog :: (MonadLogger m, Show e) => ExceptT e m a -> m ()
Logging levels
errorLevel :: LogLevel Source #
The log level for errors.
debugLevel :: LogLevel Source #
The log level for debug messages.
traceLevel :: LogLevel Source #
The log level for trace messages.
Log messages
data LogMessage Source #
A logged message along with a level to log it at and an origin.
Log handling
type LogHandler = LogMessage -> IO () Source #
A processor for log messages.
simpleLogHandler :: LogLevel -> LogHandler Source #
A simple stdout-based log handler.
noopLogHandler :: LogHandler Source #
A log handler that swallows messages and outputs nothing.
class Monad m => MonadLogger m where Source #
logMessage :: LogMessage -> m () Source #
Logs the given message within the monad.
Instances
MonadLogger (LighthouseIO s) Source # | |
Defined in Lighthouse.Connection logMessage :: LogMessage -> LighthouseIO s () Source # | |
MonadLogger m => MonadLogger (MaybeT m) Source # | |
Defined in Lighthouse.Utils.Logging logMessage :: LogMessage -> MaybeT m () Source # | |
MonadLogger m => MonadLogger (ExceptT e m) Source # | |
Defined in Lighthouse.Utils.Logging logMessage :: LogMessage -> ExceptT e m () Source # | |
MonadLogger m => MonadLogger (ReaderT r m) Source # | |
Defined in Lighthouse.Utils.Logging logMessage :: LogMessage -> ReaderT r m () Source # | |
MonadLogger m => MonadLogger (StateT s m) Source # | |
Defined in Lighthouse.Utils.Logging logMessage :: LogMessage -> StateT s m () Source # | |
(Monoid w, MonadLogger m) => MonadLogger (WriterT w m) Source # | |
Defined in Lighthouse.Utils.Logging logMessage :: LogMessage -> WriterT w m () Source # |
Convenience functions
runExceptTOrLog :: (MonadLogger m, Show e) => ExceptT e m a -> m () Source #
Runs the ExceptT transformer or logs if needed.