Hopefully useful: macro-controlled logger

Michael Zhilin mizhka at gmail.com
Sun Dec 10 09:00:44 UTC 2017


Hi Eric!

Nice! This minimalistic and powerful approach looks very nice.

We have similar thing in one of kernel driver:
https://github.com/freebsd/freebsd/blob/master/sys/dev/bhnd/bhnd_debug.h

In my opinion such kind of thing is demanded.

Best regards,
Michael.

9 дек. 2017 г. 7:52 ПП пользователь "Eric McCorkle" <eric at metricspace.net>
написал:

> 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.
> _______________________________________________
> freebsd-hackers at freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-hackers
> To unsubscribe, send any mail to "freebsd-hackers-unsubscribe at freebsd.org"
>


More information about the freebsd-hackers mailing list