Karya, built on Mon Jul 24 11:39:07 PDT 2017 (patch 33511aca01257b76b88de7c7a2763b7a965c084e)

Safe HaskellNone

LogView.LogView

Description

This is a standalone program to monitor the log file.

It reads lines and streams them to the GUI, which displays them in a scrolling box. Clickable text is surrounded by {}s and will be highlighted blue in the GUI. When it's clicked, the GUI sends the tag back, much like an HTML href. For example, stack traces are formatted as a REPL cmd that will highlight that location on the score.

The top line is the status bar, which extracts and remembers bits of specially formatted log msgs. This effectively functions as the app's global status bar, since otherwise it has no place for this kind of information. The configuration is default_catch_patterns.

This also maintains a filter. The filter is a little language that will filter out messages that don't match, documented by Process.compile_filter.

In addition, there is a concept of Process.CatchPatterns. These are regexes which are matched against msg text. When one matches, the matched groups are kept in a status line. That way, events reported in the log can be collected together.

Synopsis

Documentation

pid_file :: FilePath Source #

I use this file to only start one logview at a time.

initial_filter :: Text Source #

Initial contents of the filter field.

default_catch_patterns :: [Process.CatchPattern] Source #

Built-in list of catch patterns.

I wound up having the app emit catch patterns explicitly instead of putting the smarts in logview, so now the only CatchPattern is Process.global_status_pattern. But it still seems conceivable that someday I may want logview to catch things the app didn't explicitly mean to be caught, so I'll leave this functionality in for now.

default_history :: Int Source #

Remember this many log msgs.

default_max_bytes :: Int Source #

UI will remember this many bytes. This is not the same as default_history because the history will remember filtered out msgs, and the UI doesn't bother to preserve msg boundaries so it uses bytes.

data Flag Source #

Instances

Eq Flag # 

Methods

(==) :: Flag -> Flag -> Bool #

(/=) :: Flag -> Flag -> Bool #

Show Flag # 

Methods

showsPrec :: Int -> Flag -> ShowS #

show :: Flag -> String #

showList :: [Flag] -> ShowS #

main :: IO () Source #

logview :: [Flag] -> IO () Source #

write_pid :: IO (Maybe ProcessID) Source #

If a logview is already running, return its pid, otherwise write the current pid.

data Msg Source #

Instances

Show Msg # 

Methods

showsPrec :: Int -> Msg -> ShowS #

show :: Msg -> String #

showList :: [Msg] -> ShowS #