Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 9 Dec 2017 11:52:10 -0500
From:      Eric McCorkle <eric@metricspace.net>
To:        "freebsd-hackers@freebsd.org" <freebsd-hackers@freebsd.org>
Subject:   Hopefully useful: macro-controlled logger
Message-ID:  <0dd5240f-6c70-425f-7e98-7946097ea3ef@metricspace.net>

next in thread | raw e-mail | index | archive | help
Hi folks,

At some point in the past, I recall reading about a log4j-inspired
logging API for C that used the preprocessor to avoid introducing
runtime overhead.  However, I've never been able to find this library,
so I've used my own scrappy macro collection over the years.

Anyway, on a recent flight I decided to implement a macro-controlled
logging API in earnest.

The github project can be found here: https://github.com/emc2/mcl

It provides the ability to define module-specific loggers, log at
different levels, and set a threshold for dynamically-controlled logging
levels.  Any log message more severe than the dynamic range will be
hardwired in place, and any message less severe will be removed at
compilation time.

It's not large or complicated at all, but hopefully someone will find it
useful.  If they do, I'd be more than happy to have it added to the
FreeBSD base system.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?0dd5240f-6c70-425f-7e98-7946097ea3ef>