coloredstderr (0.2)

back

coloredstderr is a small library which uses LD_PRELOAD to color stderr. It “follows” dups, has minimal performance overhead and can ignore certain binaries (requires /proc).

Like all solutions using LD_PRELOAD it only works with dynamically linked binaries. Statically linked binaries, for example valgrind, are not supported. setuid binaries are also not supported (LD_PRELOAD disabled for security reasons).

Most other existing solutions use a second process which colors its input and pipe stderr to it. However this creates different runtime behaviour resulting in a different ordering of the output. Partial lines (no newline) also often cause problems. coloredstderr handles these cases correctly.


It was inspired by stderred [2]. Similar solutions (using LD_PRELOAD) include:

[1]: https://github.com/sickill/stderred
[2]: https://github.com/trapd00r/stderred

coloredstderr is licensed under GPL 3 (or later).

Requirements

Supported Systems

Tested on GNU/Linux, FreeBSD and Mac OS X (partial support). Should work on all POSIX systems which support LD_PRELOAD (with minor modifications).

Usage

Add the following settings to your shell configuration:

LD_PRELOAD=/absolute/path/to/libcoloredstderr.so
COLORED_STDERR_FDS=2,
export LD_PRELOAD COLORED_STDERR_FDS

Also see README in tarball.

Download

Current development happens in the git repository (also browsable as Gitweb):

git clone https://ruderich.org/simon/coloredstderr/coloredstderr.git
Last updated 2018-05-20 17:09:22 CEST

Impressum Datenschutzerklärung