Karya, built on 2023-08-29T07:47:28 (patch 7a412d5d6ba4968ca4155ef276a062ccdeb9109a)
Safe HaskellSafe-Inferred

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

Instances details
Show Flag Source # 
Instance details

Defined in LogView.LogView

Methods

showsPrec :: Int -> Flag -> ShowS #

show :: Flag -> String #

showList :: [Flag] -> ShowS #

Eq Flag Source # 
Instance details

Defined in LogView.LogView

Methods

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

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

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

Instances details
Show Msg Source # 
Instance details

Defined in LogView.LogView

Methods

showsPrec :: Int -> Msg -> ShowS #

show :: Msg -> String #

showList :: [Msg] -> ShowS #

strip_paths :: Text -> Log.Msg -> Log.Msg Source #

Internally I use absolute paths, but they're pretty verbose. So turn them back into relative paths.