| 1 |
.TH clog 1 2016-06-27 "${PACKAGE_STRING}" "User Manuals" |
| 2 |
|
| 3 |
.SH NAME |
| 4 |
clog \- colorized log filter |
| 5 |
|
| 6 |
.SH SYNOPSIS |
| 7 |
.B clog [<options>] [<section> ...] |
| 8 |
|
| 9 |
-h|--help Show this usage |
| 10 |
-v|--version Show this version |
| 11 |
-d|--date Prepend all lines with the current date |
| 12 |
-t|--time Prepend all lines with the current time |
| 13 |
-f|--file Override default ~/.clogrc |
| 14 |
|
| 15 |
.SH DESCRIPTION |
| 16 |
Clog is a filter command, and therefore copies its input to its output. But if |
| 17 |
lines in the input match certain patterns, actions are taken, which are defined |
| 18 |
as 'rules'. |
| 19 |
|
| 20 |
The rules are defined in ~/.clogrc as text patterns or regular expressions, and |
| 21 |
the actions are specified, to colorize either the line or matching pattern, or |
| 22 |
perhaps to suppress the line. |
| 23 |
|
| 24 |
If --date is specified the current date, YYYY-MM-DD, is prepended to all lines. |
| 25 |
|
| 26 |
If --time is specified the current time, HH:MM:SS, is prepended to all lines. |
| 27 |
|
| 28 |
If --file is specified, an alternate configuration rc file may be specified. |
| 29 |
Default is to ~/.clogrc |
| 30 |
|
| 31 |
One or more section arguments may be specified. If none are provided, 'default' |
| 32 |
is assumed. A section corresponds to a named rule set defined in ~/.clogrc. and |
| 33 |
allows the use of one .clogrc file to serve multiple different uses of clog. |
| 34 |
If more than one section is specified, the rules sets are combined, in the |
| 35 |
sequence found. |
| 36 |
|
| 37 |
.SH CONFIGURATION FILE AND OVERRIDE OPTIONS |
| 38 |
Clog reads its configuration from a file in the user's home directory: |
| 39 |
~/.clogrc. |
| 40 |
|
| 41 |
The format of the rules is: |
| 42 |
|
| 43 |
.RS |
| 44 |
<section> rule /<pattern>/ --> <color> <action> |
| 45 |
.br |
| 46 |
<section> rule "<pattern>" --> <color> <action> |
| 47 |
.RE |
| 48 |
|
| 49 |
If the pattern is surrounded by / characters, it is interpreted as a regular |
| 50 |
expression. If the pattern is surrounded by " characters, it is interpreted as |
| 51 |
a string fragment. |
| 52 |
|
| 53 |
The section is simply a way to allow multiple rules sets, so that one .clogrc |
| 54 |
file can serve multiple uses. The pattern may be any supported Standard C |
| 55 |
Library regular expression. Action must be one of 'line', 'match', 'suppress' |
| 56 |
or 'blank'. |
| 57 |
|
| 58 |
Note that there is a default section, called 'default'. Putting rules in the |
| 59 |
default section means that no section need be specified on the command line. |
| 60 |
|
| 61 |
Any color can be used, in both the 16- and 256-color space. Some examples are: |
| 62 |
|
| 63 |
.RS |
| 64 |
bold |
| 65 |
.br |
| 66 |
underline |
| 67 |
.br |
| 68 |
bold blue |
| 69 |
.br |
| 70 |
underline on green |
| 71 |
.br |
| 72 |
black on white |
| 73 |
.br |
| 74 |
bold red on bright white |
| 75 |
.br |
| 76 |
rgb200 on grey4 |
| 77 |
.RE |
| 78 |
|
| 79 |
Instead of coloring the whole line, specifying 'match' instead will only color |
| 80 |
the parts of the line that match. |
| 81 |
|
| 82 |
.SH EXAMPLE Rulesets |
| 83 |
Here is an example ~/.clogrc file. |
| 84 |
|
| 85 |
.RS |
| 86 |
# Standard syslog entries. |
| 87 |
.br |
| 88 |
default rule /warn|debug/ --> yellow line |
| 89 |
.br |
| 90 |
default rule /error|severe/ --> red line |
| 91 |
.br |
| 92 |
default rule /critical/ --> bold red line |
| 93 |
.br |
| 94 |
default rule /critical/ --> blank |
| 95 |
.br |
| 96 |
default rule /ignore/ --> suppress |
| 97 |
.br |
| 98 |
|
| 99 |
.br |
| 100 |
# Apache access.log status codes |
| 101 |
.br |
| 102 |
apache rule / 2[0-9][0-9] / --> green match |
| 103 |
.br |
| 104 |
apache rule / 3[0-9][0-9] / --> yellow match |
| 105 |
.br |
| 106 |
apache rule / 4[0-9][0-9] / --> red match |
| 107 |
.br |
| 108 |
apache rule / 5[0-9][0-9] / --> bold red match |
| 109 |
.RE |
| 110 |
|
| 111 |
.SH "CREDITS & COPYRIGHTS" |
| 112 |
Copyright (C) 2006 \- 2016 P. Beckingham, F. Hernandez. |
| 113 |
.br |
| 114 |
Copyright (C) 2006 \- 2016 Goteborg Bit Factory. |
| 115 |
|
| 116 |
Clog is distributed under the MIT license. See |
| 117 |
http://www.opensource.org/licenses/mit-license.php for more information. |
| 118 |
|
| 119 |
.SH SEE ALSO |
| 120 |
For more information, see: |
| 121 |
|
| 122 |
.TP |
| 123 |
The official site at |
| 124 |
<http://tasktools.org/clog.html> |
| 125 |
|
| 126 |
.TP |
| 127 |
The official code repository at |
| 128 |
<https://git.tasktools.org/scm/ut/clog.git> |
| 129 |
|
| 130 |
.TP |
| 131 |
You can contact the project by emailing |
| 132 |
<[email protected]> |
| 133 |
|
| 134 |
.SH REPORTING BUGS |
| 135 |
.TP |
| 136 |
Bugs in Taskwarrior may be reported to the issue-tracker at |
| 137 |
<https://bug.tasktools.org/> |
| 138 |
|