xref: /glogg/doc/documentation.markdown (revision 821cac888d515a4e41b5d4ba4130c56db4463501)
1
2## Getting started
3
4_glogg_ can be started from the command line, optionally passing the file to
5open as an argument, or via the desktop environment's menu or file
6association.
7If no file name is passed, _glogg_ will initially open the last used file.
8
9The main window is divided in three parts : the top displays the log file. The
10bottom part, called the "filtered view", shows the results of the search. The
11line separating the two contains the regular expression used as a filter.
12
13Entering a new regular expression, or a simple search term, will update the
14bottom view, displaying the results of the search. The lines matching the
15search criteria are listed in order in the results, and are marked with a red
16circle in both windows.
17
18## Exploring log files
19
20Regular expressions are a powerful way to extract the information you are
21interested in from the log file. _glogg_ uses _extended regular expressions_.
22
23One of the most useful regexp feature when exploring logs is the
24_alternation_, using parentheses and the | operator. It searches for several
25alternatives, permitting to display several line types in the filtered window,
26in the same order they appear in the log file.
27
28For example, to check that every connection opened is also closed, one can use
29an expression similar to:
30
31`Entering (Open|Close)Connection`
32
33Any 'open' call without a matching 'close' will immediately be obvious in the
34filtered window.
35The alternation also works with the whole search line. For example if you also
36want to know what kind of connection has been opened:
37
38`Entering (Open|Close)Connection|Created a .* connection`
39
40`.*` will match any sequence of character on a single line, but _glogg_ will only
41display lines with a space and the word `connection` somewhere after `Created a`
42
43In addition to the filtered window, the match overview on the right hand side
44of the screen offers a view of the position of matches in the log file. Matches
45are showed as small red lines.
46
47## Using filters
48
49_Filters_ can colorize some lines of the log being displayed, for example to
50draw attention to lines indicating an error, or to associate a color with each
51sort of event. Any number of filter can be defined in the 'Filters'
52configuration dialog, each using a regexp against which lines will be matched.
53For each line, all filters are tried in order and the fore and back colors of
54the first successful filter are applied.
55
56## Marking lines in the log file
57
58In addition to regexp matches, _glogg_ enable the user to mark any interesting
59line in the log. To do this, click on the round bullet in the left margin in
60front of the line that needs to be marked.
61
62Marks are combined with matches and showed in the filtered window. They also
63appears as blue lines in the match overview.
64
65## Browsing changing log files
66
67_glogg_ can display and search through logs while they are written to disk, as
68it might be the case when debugging a running program or server.
69The log is automatically updated when it grows, but the 'Auto-refresh' option
70must be enabled if you want the search results to be automatically refreshed as
71well.
72
73The 'f' key might be used to follow the end of the file as it grows (_a la_
74`tail -f`).
75
76## Settings
77### Font
78
79The font used to display the log file. A clear, monospace font (like the free,
80open source, [DejaVu Mono](http://www.dejavu-fonts.org/) for example) is
81recommended.
82
83### Search options
84
85Determines which type of regular expression _glogg_ will use when filtering
86lines for the bottom window, and when using QuickFind.
87
88* Extended Regexp: the default, uses regular expressions similar to those used by Perl
89* Wildcards: uses wildcards (\*, ? and []) in a similar fashion as a Unix shell
90* Fixed Strings: searches for the text exactly as it is written, no character is special
91
92## Keyboard commands
93
94_glogg_ keyboard commands try to approximatively emulate the default bindings
95used by the classic Unix utilities _vi_ and _less_.
96
97The main commands are:
98<table>
99<tr><td>arrows</td>
100    <td>scroll one line up/down or one column left/right</td></tr>
101<tr><td>[number] j/k</td>
102    <td>move the selection 'number' (or one) line down/up</td></tr>
103<tr><td>h/l</td>
104    <td>scroll left/right</td></tr>
105<tr><td>[number] g</td>
106    <td>jump to the line number given or the first one if no number is entered</td></tr>
107<tr><td>G</td>
108    <td>jump to the last line of the file (selecting it)</td></tr>
109<tr><td>/</td>
110    <td>start a quickfind search in the current screen</td></tr>
111<tr><td>n/N</td>
112    <td>repeat the previous quickfind search forward/backward</td></tr>
113<tr><td>*/#</td>
114    <td>search for the next/previous occurence of the currently selected text</td></tr>
115<tr><td>f</td>
116    <td>activate 'follow' mode, which keep the display as the tail of the file (like "tail -f")</td></tr>
117</table>
118