Safe Haskell | None |
---|---|
Language | Haskell98 |
System.Log.Simple.Base
- data Level
- data Politics = Politics {}
- data Rule = Rule {}
- type Rules = [Rule]
- defaultPolitics :: Politics
- debugPolitics :: Politics
- tracePolitics :: Politics
- silentPolitics :: Politics
- supressPolitics :: Politics
- rule :: ([Text] -> Bool) -> (Politics -> Politics) -> Rule
- absolute :: [Text] -> [Text] -> Bool
- relative :: [Text] -> [Text] -> Bool
- child :: ([Text] -> Bool) -> [Text] -> Bool
- root :: [Text] -> Bool
- path :: Text -> [Text] -> Bool
- (%=) :: Text -> (Politics -> Politics) -> Rule
- politics :: Level -> Level -> Politics -> Politics
- use :: Politics -> Politics -> Politics
- low :: Level -> Politics -> Politics
- high :: Level -> Politics -> Politics
- data Message = Message {
- messageTime :: ZonedTime
- messageLevel :: Level
- messagePath :: [Text]
- messageText :: Text
- type Converter a = Message -> a
- data Consumer a = Consumer {
- withConsumer :: ((a -> IO ()) -> IO ()) -> IO ()
- data Entry
- data Command
- = EnterScope Text Rules
- | LeaveScope (IO ())
- | PostMessage Message
- entries :: [Command] -> [Entry]
- flatten :: [Entry] -> [Command]
- rules :: Rules -> [Text] -> [Entry] -> [Entry]
- type Logger = Consumer Message
- logger :: Converter a -> Consumer a -> Consumer Message
- type RulesLoad = IO (IO Rules)
- data Log = Log {}
- noLog :: Log
- newLog :: RulesLoad -> [Logger] -> IO Log
- writeLog :: MonadIO m => Log -> Level -> Text -> m ()
- scopeLog_ :: MonadCatchIO m => Log -> Text -> m a -> m a
- scopeLog :: MonadCatchIO m => Log -> Text -> m a -> m a
- scoperLog :: MonadCatchIO m => Show a => Log -> Text -> m a -> m a
Documentation
Level of message
Scope politics
Constructors
Politics | |
Fields
|
Rule for politics
defaultPolitics :: Politics Source
Default politics
debugPolitics :: Politics Source
Debug politics
tracePolitics :: Politics Source
Trace politics
silentPolitics :: Politics Source
Silent politics
supressPolitics :: Politics Source
Supress all messages politics
path :: Text -> [Text] -> Bool Source
Scope-path by text
/ -- root foo/bar -- relative /foo/bar -- absolute foo/bar/ -- child of relative /foo/bar/ -- child of absolute
Log message
Constructors
Message | |
Fields
|
Log entry, scope or message
Command to logger
Constructors
EnterScope Text Rules | |
LeaveScope (IO ()) | |
PostMessage Message |
logger :: Converter a -> Consumer a -> Consumer Message Source
Convert consumer creater to logger creater
Log
Instances
MonadCatchIO m => MonadLog (ReaderT Log m) Source |
newLog :: RulesLoad -> [Logger] -> IO Log Source
Create log
Messages from distinct threads are splitted in several chans, where they are processed, and then messages combined back and sent to log-thread
scopeLog_ :: MonadCatchIO m => Log -> Text -> m a -> m a Source
New log-scope
scopeLog :: MonadCatchIO m => Log -> Text -> m a -> m a Source
New log-scope with lifting exceptions as errors