xref: /glogg/doc/documentation.markdown (revision 7d862d7eb72f975a348b2f6e3520b8fef56f2cc7)
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
43## Using filters
44
45_Filters_ can colorize some lines of the log being displayed, for example to
46draw attention to lines indicating an error, or to associate a color with each
47sort of event. Any number of filter can be defined in the 'Filters'
48configuration dialog, each using a regexp against which lines will be matched.
49For each line, all filters are tried in order and the fore and back colors of
50the first successful filter are applied.
51
52## Browsing changing log files
53
54_glogg_ can display and search through logs while they are written to disk, as
55it might be the case when debugging a running program or server.
56The log is automatically updated when it grows, but the 'Auto-refresh' option
57must be enabled if you want the search results to be automatically refreshed as
58well.
59
60The 'f' key might be used to follow the end of the file as it grows (_a la_
61`tail -f`).
62
63## Settings
64### Font
65
66The font used to display the log file. A clear, monospace font (like the free,
67open source, [DejaVu Mono](http://www.dejavu-fonts.org/) for example) is
68recommended.
69
70### Search options
71
72Determines which type of regular expression _glogg_ will use when filtering
73lines for the bottom window, and when using QuickFind.
74
75* Extended Regexp: the default, uses regular expressions similar to those used by Perl
76* Wildcards: uses wildcards (\*, ? and []) in a similar fashion as a Unix shell
77* Fixed Strings: searches for the text exactly as it is written, no character is special
78
79## Keyboard commands
80
81_glogg_ keyboard commands try to approximatively emulate the default bindings
82used by the classic Unix utilities _vi_ and _less_.
83
84The main commands are:
85<table>
86<tr><td>arrows</td>
87    <td>scroll one line up/down or one column left/right</td></tr>
88<tr><td>[number] j/k</td>
89    <td>move the selection 'number' (or one) line down/up</td></tr>
90<tr><td>h/l</td>
91    <td>scroll left/right</td></tr>
92<tr><td>[number] g</td>
93    <td>jump to the line number given or the first one if no number is entered</td></tr>
94<tr><td>G</td>
95    <td>jump to the last line of the file (selecting it)</td></tr>
96<tr><td>/</td>
97    <td>start a quickfind search in the current screen</td></tr>
98<tr><td>n/N</td>
99    <td>repeat the previous quickfind search forward/backward</td></tr>
100<tr><td>*/#</td>
101    <td>search for the next/previous occurence of the currently selected text</td></tr>
102<tr><td>f</td>
103    <td>activate 'follow' mode, which keep the display as the tail of the file (like "tail -f")</td></tr>
104</table>
105