loghorn libraryloghorn is a plain C (actually, ANSI C) library for logging
and message printing; generally, it lets you have diagnostic message
printing statements all across your code, each with its own "severity
level", and determine in your main program which of these statements will
actually work, and how.
Despite the library is built as a single .a file, it
consists of two modules not intended to work together:
message module is intended for "batch" programs, which
means programs that take all they need from the command line, then do some
job and optionally output some messages; it is supposed the command line
arguments determine what we call verbosity level (e.g. with
options like -q for quiet and/or -v for verbose),
and the main program passes the resulting level to the library;servlog module is for "daemons". that is, programs
which normally detach from the terminal and keep working, like various
servers; this module lets the main program configure any combination of
"channels", having messages go to syslog, to a dedicated log file, to the
stderr, and to any number of "auxilliary" channels implemented by callback
functions (aux channels are useful for daemons that have control consoles,
like TCP ports or AF_LOCAL sockets); each channel has its own verbosity
level and the "private" flag; for the syslog channel, both "facility" and
"program identity" are configurable.
Sorry guys, as usual there's no documentation for the library. My bad. Take a look at the headers though, they contain a lot of commentary.
The library is dually licensed: you can use it either under the terms and condition of CROCO'S INDIVIDUALISTIC FREE SOFTWARE LICENSE, any version published by Andrey Vikt. Stolyarov, not older than the date when the library itself (the version in question) was published, or, at your option, you can use the well-known GNU LESSER GENERAL PUBLIC LICENSE version 2.1, as published by Free Software Foundation, Inc.
Last updated May 12, 2026