Cat syslog files to stdout with ANSI escape highlighting
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
Daniel Eklöf 06d433f785
meson: bump C standard to c18
2 years ago
completions completions: zsh: initial 2 years ago
.gitignore gitignore: bld directory + makepkg generated directories 2 years ago
PKGBUILD PKGBUILD: bump pkgver to 1.0.0 2 years ago
README.md README: examples on single lines 2 years ago
generate-version.sh generate-version: check for .git directory in *src* dir 2 years ago
logcat.c logcat: translate facility names to emojis, by default 2 years ago
meson.build meson: bump C standard to c18 2 years ago

README.md

logcat

logcat is a small utility that parses syslog files and prints them to stdout, highlighted with ANSI escape sequences.

The regex used to match the various parts of a log message is currently hard coded and intended to match log messages on the following format:

  • $DATE [$FACILITY|$PRIORITY] $PROGRAM[$PID]: $MSG
  • $DATE [$PRIORITY]: $MSG

In syslog-ng, this can be achieved with template(), in destination definitions.

Example:

destination d_kernel { file("/var/log/kernel.log" template("$DATE [$PRIORITY]: $MSG\n")); };
destination d_system { file("/var/log/system.log" template("$DATE [$FACILITY|$PRIORITY] $PROGRAM[$PID]: $MSG\n")); };