Safe Haskell | None |
---|---|
Language | Haskell2010 |
This module contains generic types definition, along with some utilities.
- type LogSource = [String]
- data LogMessage = VarContainer vars => LogMessage {
- lmLevel :: LogLevel
- lmSource :: LogSource
- lmLocation :: Loc
- lmFormatString :: Text
- lmFormatVars :: vars
- type LogFilter = [(LogSource, LogLevel)]
- class IsLogBackend b where
- data LogBackend = IsLogBackend b => LogBackend b
- type Logger = LogMessage -> IO ()
- newtype LoggingT m a = LoggingT (ReaderT Logger m a)
- runLoggingT :: LoggingT m a -> Logger -> m a
- defaultLogFilter :: LogFilter
- splitString :: Char -> String -> [String]
- splitDots :: String -> [String]
- logMessage :: MonadIO m => LogMessage -> LoggingT m ()
Documentation
type LogSource = [String] Source #
Log message source. This is usually a list of program module names,
for example ["System", "Log", "Heavy", "Types"]
.
data LogMessage Source #
Log message structure
VarContainer vars => LogMessage | |
|
type LogFilter = [(LogSource, LogLevel)] Source #
Log messages filter by source and level.
Semantics under this is that (source, severity)
pair allows to write
messages from source
of severity
(and all more important messages) to log.
class IsLogBackend b where Source #
Logging backend class.
data LogBackend Source #
A container for arbitrary logging backend. You usually will use this similar to:
getLoggingSettings :: String -> LogBackend getLoggingSettings "syslog" = LogBackend defaultsyslogsettings
IsLogBackend b => LogBackend b |
type Logger = LogMessage -> IO () Source #
Logging function
Logging monad transformer.
MonadTrans LoggingT Source # | |
MonadTransControl LoggingT Source # | |
(MonadBaseControl IO m, MonadIO m) => MonadBaseControl IO (LoggingT m) Source # | |
MonadIO m => MonadBase IO (LoggingT m) Source # | |
Monad m => MonadReader Logger (LoggingT m) Source # | |
Monad m => Monad (LoggingT m) Source # | |
Functor m => Functor (LoggingT m) Source # | |
Applicative m => Applicative (LoggingT m) Source # | |
MonadIO m => MonadIO (LoggingT m) Source # | |
MonadIO m => MonadLogger (LoggingT m) Source # | |
type StT LoggingT a Source # | |
type StM (LoggingT m) a Source # | |
runLoggingT :: LoggingT m a -> Logger -> m a Source #
Run logging monad
defaultLogFilter :: LogFilter Source #
Default log messages filter. This says pass all messages of level Info or higher.
splitString :: Char -> String -> [String] Source #
Simple implementation of splitting string by character.
logMessage :: MonadIO m => LogMessage -> LoggingT m () Source #
Log a message