Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data Level
- level :: Text -> Maybe Level
- level_ :: Text -> Level
- newtype Component = Component {
- componentPath :: [Text]
- newtype Scope = Scope {}
- data Message = Message {}
- type Converter a = Message -> a
- type Consumer a = ContT () IO (a -> IO ())
- consumer :: (((a -> IO ()) -> IO ()) -> IO ()) -> Consumer a
- type LogHandler = Consumer Message
- handler :: Converter a -> Consumer a -> Consumer Message
- data LogConfig = LogConfig {}
- defCfg :: LogConfig
- logCfg :: [(Component, Level)] -> LogConfig
- componentCfg :: Component -> Lens' LogConfig (Maybe Level)
- componentLevel :: LogConfig -> Component -> Level
- data Log = Log {
- logComponent :: Component
- logScope :: Scope
- logPost :: Message -> IO ()
- logStop :: IO ()
- logConfig :: MVar LogConfig
- logHandlers :: MVar [LogHandler]
- logRestartHandlers :: IO ()
- newLog :: LogConfig -> [LogHandler] -> IO Log
- rootLog :: Log -> Log
- getLog :: Component -> Scope -> Log -> Log
- subLog :: Component -> Scope -> Log -> Log
- getLogConfig :: MonadIO m => Log -> m LogConfig
- updateLogConfig :: MonadIO m => Log -> (LogConfig -> LogConfig) -> m LogConfig
- updateLogHandlers :: MonadIO m => Log -> ([LogHandler] -> [LogHandler]) -> m ()
- writeLog :: MonadIO m => Log -> Level -> Text -> m ()
- stopLog :: MonadIO m => Log -> m ()
Documentation
Level of message
Instances
Bounded Level Source # | |
Enum Level Source # | |
Defined in System.Log.Simple.Base | |
Eq Level Source # | |
Ord Level Source # | |
Read Level Source # | |
Show Level Source # | |
Default Level Source # | |
Defined in System.Log.Simple.Base | |
Formattable Level Source # | |
Defined in System.Log.Simple.Base formattable :: Level -> FormatFlags -> Formatted # |
Component — each one have separate log scopes and can have different politics Child component's root politics inherits its parent root politics Component name parts stored in reverse order
Component | |
|
Instances
Eq Component Source # | |
Ord Component Source # | |
Defined in System.Log.Simple.Base | |
Read Component Source # | |
Show Component Source # | |
IsString Component Source # | |
Defined in System.Log.Simple.Base fromString :: String -> Component # | |
Semigroup Component Source # | |
Monoid Component Source # | |
NFData Component Source # | |
Defined in System.Log.Simple.Base | |
Formattable Component Source # | |
Defined in System.Log.Simple.Base formattable :: Component -> FormatFlags -> Formatted # |
Log scope, also stored in reverse order
Instances
Eq Scope Source # | |
Ord Scope Source # | |
Read Scope Source # | |
Show Scope Source # | |
IsString Scope Source # | |
Defined in System.Log.Simple.Base fromString :: String -> Scope # | |
Semigroup Scope Source # | |
Monoid Scope Source # | |
NFData Scope Source # | |
Defined in System.Log.Simple.Base | |
Formattable Scope Source # | |
Defined in System.Log.Simple.Base formattable :: Scope -> FormatFlags -> Formatted # |
Log message
Message | |
|
type LogHandler = Consumer Message Source #
Message handler
Instances
Show LogConfig Source # | |
Default LogConfig Source # | |
Defined in System.Log.Simple.Base | |
Ixed LogConfig Source # | |
Defined in System.Log.Simple.Base | |
At LogConfig Source # | |
type Index LogConfig Source # | |
Defined in System.Log.Simple.Base | |
type IxValue LogConfig Source # | |
Defined in System.Log.Simple.Base |
logCfg :: [(Component, Level)] -> LogConfig Source #
Make log config by list of components and levels
Log
Log | |
|
newLog :: LogConfig -> [LogHandler] -> IO Log Source #
Create log, returns root logger for root component
Messages from distinct threads and components are splitted in several chans, where they are processed, and then messages combined back and sent to log-thread
updateLogConfig :: MonadIO m => Log -> (LogConfig -> LogConfig) -> m LogConfig Source #
Modify log config
updateLogHandlers :: MonadIO m => Log -> ([LogHandler] -> [LogHandler]) -> m () Source #
Update log handlers, this restarts handlers thread