Blame


1 830f00e9 2020-04-20 alex #!/bin/bash
2 80437b25 2019-11-10 alex #
3 80437b25 2019-11-10 alex # ngIRCd -- The Next Generation IRC Daemon
4 14777c18 2020-04-19 alex # Copyright (c)2001-2020 Alexander Barton (alex@barton.de) and Contributors
5 80437b25 2019-11-10 alex #
6 80437b25 2019-11-10 alex # This program is free software; you can redistribute it and/or modify
7 80437b25 2019-11-10 alex # it under the terms of the GNU General Public License as published by
8 80437b25 2019-11-10 alex # the Free Software Foundation; either version 2 of the License, or
9 80437b25 2019-11-10 alex # (at your option) any later version.
10 80437b25 2019-11-10 alex # Please read the file COPYING, README and AUTHORS for more information.
11 80437b25 2019-11-10 alex #
12 80437b25 2019-11-10 alex # This script parses the log output of ngircd(8), and colorizes the messages
13 80437b25 2019-11-10 alex # accoring to their log level. Example usage:
14 80437b25 2019-11-10 alex # ./src/ngircd/ngircd -f $PWD/doc/sample-ngircd.conf -np | ./contrib/nglog.sh
15 80437b25 2019-11-10 alex #
16 80437b25 2019-11-10 alex
17 8a37695b 2020-05-03 alex gawk '
18 1f69f1d0 2019-12-07 alex /^\[[[:digit:]]+:0 / {print "\033[1;95m" $0 "\033[0m"}
19 1f69f1d0 2019-12-07 alex /^\[[[:digit:]]+:1 / {print "\033[1;35m" $0 "\033[0m"}
20 1f69f1d0 2019-12-07 alex /^\[[[:digit:]]+:2 / {print "\033[1;91m" $0 "\033[0m"}
21 1f69f1d0 2019-12-07 alex /^\[[[:digit:]]+:3 / {print "\033[1;31m" $0 "\033[0m"}
22 1f69f1d0 2019-12-07 alex /^\[[[:digit:]]+:4 / {print "\033[1;33m" $0 "\033[0m"}
23 80437b25 2019-11-10 alex /^\[[[:digit:]]+:5 / {print "\033[1m" $0 "\033[0m"}
24 80437b25 2019-11-10 alex /^\[[[:digit:]]+:6 / {print $0}
25 80437b25 2019-11-10 alex /^\[[[:digit:]]+:7 / {print "\033[90m" $0 "\033[0m"}
26 14777c18 2020-04-19 alex ' </dev/stdin &
27 14777c18 2020-04-19 alex
28 14777c18 2020-04-19 alex wait