lighthouse-client-0.2.0.0: Project Lighthouse client SDK
Safe HaskellSafe-Inferred
LanguageHaskell2010

Lighthouse.Utils.Logging

Synopsis

Logging levels

data LogLevel Source #

The level to log at.

Constructors

LogLevel 

Fields

errorLevel :: LogLevel Source #

The log level for errors.

warnLevel :: LogLevel Source #

The log level for warnings.

infoLevel :: LogLevel Source #

The log level for informational messages.

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.

Constructors

LogMessage 

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 #

Methods

logMessage :: LogMessage -> m () Source #

Logs the given message within the monad.

Instances

Instances details
MonadLogger (LighthouseIO s) Source # 
Instance details

Defined in Lighthouse.Connection

MonadLogger m => MonadLogger (MaybeT m) Source # 
Instance details

Defined in Lighthouse.Utils.Logging

Methods

logMessage :: LogMessage -> MaybeT m () Source #

MonadLogger m => MonadLogger (ExceptT e m) Source # 
Instance details

Defined in Lighthouse.Utils.Logging

Methods

logMessage :: LogMessage -> ExceptT e m () Source #

MonadLogger m => MonadLogger (ReaderT r m) Source # 
Instance details

Defined in Lighthouse.Utils.Logging

Methods

logMessage :: LogMessage -> ReaderT r m () Source #

MonadLogger m => MonadLogger (StateT s m) Source # 
Instance details

Defined in Lighthouse.Utils.Logging

Methods

logMessage :: LogMessage -> StateT s m () Source #

(Monoid w, MonadLogger m) => MonadLogger (WriterT w m) Source # 
Instance details

Defined in Lighthouse.Utils.Logging

Methods

logMessage :: LogMessage -> WriterT w m () Source #

Convenience functions

logError :: MonadLogger m => Text -> Text -> m () Source #

Logs a message at the error level.

logWarn :: MonadLogger m => Text -> Text -> m () Source #

Logs a message at the warn level.

logInfo :: MonadLogger m => Text -> Text -> m () Source #

Logs a message at the info level.

logDebug :: MonadLogger m => Text -> Text -> m () Source #

Logs a message at the debug level.

logTrace :: MonadLogger m => Text -> Text -> m () Source #

Logs a message at the trace level.

runExceptTOrLog :: (MonadLogger m, Show e) => ExceptT e m a -> m () Source #

Runs the ExceptT transformer or logs if needed.