Selog - selective logging


Selog is a library of routines that unifies error reporting, activity logging, and debug tracing. It allows programmers to give their users flexible control over which messages are written and where they are written to.

Selog is designed to be as simple as possible while still being extremely efficient, powerful, and flexible. The essence of selog is:

Selectors determine which messages are written and where they are written to, under the control of the user's configuration. You can direct messages to any combination of stderr, syslog, files, pipes, etc. You can omit or include optional parts of messages under the control of selectors. You don't have to signal the program when you rotate its log files.

The C interface consists of just 13 functions, 5 macros, 2 types, and an enum. There are a few variations of the basic selog() one-shot logging function, or you can quickly and easily compose messages in stages. The check to skip disabled messages is extremely small and fast.

Selog can be used with C99 and C++. It comes with shell command and Lua interfaces, plus interposition libraries which you can use to fool old code that calls err() or syslog() into using selog instead.


Download


Documentation

Changes

8.7.30
8.4.10

Selog is written by Tony Finch <dot@dotat.at> <fanf2@cam.ac.uk>
at the University of Cambridge Computing Service.
You may do anything with it, at your own risk.
$Cambridge: users/fanf2/selog/Web/index.html,v 1.10 2008/07/30 18:21:11 fanf2 Exp $