xref: /glogg/doc/documentation.markdown (revision 458a6a737782306788ab092dadb5a6179695a82e)
1*458a6a73SNicolas Bonnefon
2*458a6a73SNicolas Bonnefon## Getting started
3*458a6a73SNicolas Bonnefon
4*458a6a73SNicolas Bonnefon_glogg_ can be started from the command line, optionally passing the file to
5*458a6a73SNicolas Bonnefonopen as an argument, or via the desktop environment's menu or file
6*458a6a73SNicolas Bonnefonassociation.
7*458a6a73SNicolas BonnefonIf no file name is passed, _glogg_ will initially open the last used file.
8*458a6a73SNicolas Bonnefon
9*458a6a73SNicolas BonnefonThe main window is divided in three parts : the top displays the log file. The
10*458a6a73SNicolas Bonnefonbottom part, called the "filtered view", shows the results of the search. The
11*458a6a73SNicolas Bonnefonline separating the two contains the regular expression used as a filter.
12*458a6a73SNicolas Bonnefon
13*458a6a73SNicolas BonnefonEntering a new regular expression, or a simple search term, will update the
14*458a6a73SNicolas Bonnefonbottom view, displaying the results of the search. The lines matching the
15*458a6a73SNicolas Bonnefonsearch criteria are listed in order in the results, and are marked with a red
16*458a6a73SNicolas Bonnefoncircle in both windows.
17*458a6a73SNicolas Bonnefon
18*458a6a73SNicolas Bonnefon## Exploring log files
19*458a6a73SNicolas Bonnefon
20*458a6a73SNicolas BonnefonRegular expressions are a powerful way to extract the information you are
21*458a6a73SNicolas Bonnefoninterested in from the log file. _glogg_ uses _extended regular expressions_.
22*458a6a73SNicolas Bonnefon
23*458a6a73SNicolas BonnefonOne of the most useful regexp feature when exploring logs is the
24*458a6a73SNicolas Bonnefon_alternation_, using parentheses and the | operator. It searches for several
25*458a6a73SNicolas Bonnefonalternatives, permitting to display several line types in the filtered window,
26*458a6a73SNicolas Bonnefonin the same order they appear in the log file.
27*458a6a73SNicolas Bonnefon
28*458a6a73SNicolas BonnefonFor example, to check that every connection opened is also closed, one can use
29*458a6a73SNicolas Bonnefonan expression similar to:
30*458a6a73SNicolas Bonnefon
31*458a6a73SNicolas Bonnefon`Entering (Open|Close)Connection`
32*458a6a73SNicolas Bonnefon
33*458a6a73SNicolas BonnefonAny 'open' call without a matching 'close' will immediately be obvious in the
34*458a6a73SNicolas Bonnefonfiltered window.
35*458a6a73SNicolas BonnefonThe alternation also works with the whole search line. For example if you also
36*458a6a73SNicolas Bonnefonwant to know what kind of connection has been opened:
37*458a6a73SNicolas Bonnefon
38*458a6a73SNicolas Bonnefon`Entering (Open|Close)Connection|Created a .* connection`
39*458a6a73SNicolas Bonnefon
40*458a6a73SNicolas Bonnefon`.*` will match any sequence of character on a single line, but _glogg_ will only
41*458a6a73SNicolas Bonnefondisplay lines with a space and the word `connection` somewhere after `Created a`
42*458a6a73SNicolas Bonnefon
43*458a6a73SNicolas Bonnefon## Using filters
44*458a6a73SNicolas Bonnefon
45*458a6a73SNicolas Bonnefon_Filters_ can colorize some lines of the log being displayed, for example to
46*458a6a73SNicolas Bonnefondraw attention to lines indicating an error, or to associate a color with each
47*458a6a73SNicolas Bonnefonsort of event. Any number of filter can be defined in the 'Filters'
48*458a6a73SNicolas Bonnefonconfiguration dialog, each using a regexp against which lines will be matched.
49*458a6a73SNicolas BonnefonFor each line, all filters are tried in order and the fore and back colors of
50*458a6a73SNicolas Bonnefonthe first successful filter are applied.
51*458a6a73SNicolas Bonnefon
52*458a6a73SNicolas Bonnefon## Browsing changing log files
53*458a6a73SNicolas Bonnefon
54*458a6a73SNicolas Bonnefon_glogg_ can display and search through logs while they are written to disk, as
55*458a6a73SNicolas Bonnefonit might be the case when debugging a running program or server.
56*458a6a73SNicolas BonnefonThe log is automatically updated when it grows, but the search must be
57*458a6a73SNicolas Bonnefonmanually restarted for the new matches to be found.
58*458a6a73SNicolas Bonnefon
59*458a6a73SNicolas Bonnefon## Settings
60*458a6a73SNicolas Bonnefon### Font
61*458a6a73SNicolas Bonnefon
62*458a6a73SNicolas BonnefonThe font used to display the log file. A clear, monospace font (like the free,
63*458a6a73SNicolas Bonnefonopen source, [DejaVu Mono](http://www.dejavu-fonts.org/) for example) is
64*458a6a73SNicolas Bonnefonrecommended.
65*458a6a73SNicolas Bonnefon
66*458a6a73SNicolas Bonnefon
67