Ad

stderred: Colorizes stderr output

stderred colors stderr output in red by hooking into libc. It's a shared library that works on Linux, FreeBSD, and OSX, enhancing visibility of error messages.
Screenshot of ku1ik/stderred homepage

stderred is a project that colorizes standard error (stderr) output, specifically highlighting it in red. It functions by intercepting calls to stream functions from the C standard library (libc) and injecting ANSI escape codes to modify the text. By wrapping calls to write to file descriptor 2, stderred ensures that error messages are visually distinct from standard output, making them easier to identify. The implementation leverages dynamic linker features to avoid recompiling existing programs.

stderred uses dynamic linker techniques (LD_PRELOAD, DYLD_INSERT_LIBRARIES) to modify existing programs without recompilation, offering a non-invasive solution. It supports a wide range of platforms: Linux, FreeBSD and OSX. The project provides options for customizing color codes and blacklisting specific programs from being affected, enhancing flexibility. It is a relatively lightweight solution with minimal dependencies.

  • Core Functionality: Colorizes stderr output with customizable ANSI escape codes ensuring visual differentiation from stdout.
  • Platform Support: Works on Linux (LD_PRELOAD), FreeBSD (LD_PRELOAD), and OSX (DYLD_INSERT_LIBRARIES).
  • Configuration: Allows customization of color codes and blacklisting specific programs via environment variables.
  • Dynamic Linking: Employs dynamic linker features for non-invasive modification of existing programs.
  • Multi-Architecture Support: Supports 32-bit and 64-bit binaries on Linux/FreeBSD using Dynamic String Tokens (DST) and universal libraries on OSX.

The stderred project has been developed and maintained for a significant period, with recent commits indicating ongoing support. Extensive documentation provides instructions for building and configuring the library on various platforms. A community of contributors is involved in its upkeep and improvement, and the project has a clear licensing model. The well-defined installation and usage guidelines suggest a stable and reliable tool.

Developers, system administrators, and users who need to easily identify error messages in terminal output will benefit from stderred. It addresses the problem of subtle error messages getting lost in standard output by providing a straightforward way to colorize stderr. This improves debugging, monitoring, and overall system observability compared to relying solely on default terminal color schemes or manual parsing of output.

Summarize:
Share:
Stars
1,022
Forks
117
Issues
21
Created
14 years ago
Commit
3 months ago
License
MIT
Archived
No
Updated 11 days ago

Similar Repositories