Safe Haskell | Safe-Inferred |
---|
Synopsis
- data State = State {
- state_filter :: Filter
- state_catch_patterns :: [CatchPattern]
- state_status :: Status
- state_cached_msgs :: Sequence.Seq Log.Msg
- state_last_displayed :: Maybe (Log.Msg, Int)
- initial_state :: Text -> State
- add_msg :: Int -> Log.Msg -> State -> State
- state_msgs :: State -> [Log.Msg]
- compile_filter :: Text -> Filter
- process_msg :: State -> Log.Msg -> (Maybe StyledText, State)
- type CatchPattern = (Text, Regex.Regex)
- global_status_pattern :: CatchPattern
- render_status :: Status -> StyledText
- data StyledText = StyledText {}
- match_pattern :: CatchPattern -> Text -> Map Text Text
state
State | |
|
initial_state :: Text -> State Source #
state_msgs :: State -> [Log.Msg] Source #
compile_filter :: Text -> Filter Source #
Compile a simple filter language. A log msg matches if all of the words
in the filter occur within its Log.msg_text
, and none of the words
prefixed by -
occur.
process_msg
process_msg :: State -> Log.Msg -> (Maybe StyledText, State) Source #
Process an incoming log msg. If the msg isn't filtered out, returned a colorized version. Also possibly modify the app state for things like catch and timing.
type CatchPattern = (Text, Regex.Regex) Source #
Extract text from a log msg and put it in state_status
, via
catch_regexes
.
global_status_pattern :: CatchPattern Source #
This catches msgs emitted by set_global_status
.
render_status :: Status -> StyledText Source #
data StyledText Source #
StyledText | |
|
Instances
Show StyledText Source # | |
Defined in LogView.Process showsPrec :: Int -> StyledText -> ShowS # show :: StyledText -> String # showList :: [StyledText] -> ShowS # | |
Eq StyledText Source # | |
Defined in LogView.Process (==) :: StyledText -> StyledText -> Bool # (/=) :: StyledText -> StyledText -> Bool # |
match_pattern :: CatchPattern -> Text -> Map Text Text Source #