Date: Sun, 10 Dec 2017 12:00:41 +0300 From: Michael Zhilin <mizhka@gmail.com> To: Eric McCorkle <eric@metricspace.net> Cc: freebsd-hackers@freebsd.org Subject: Re: Hopefully useful: macro-controlled logger Message-ID: <CAF19XBL6yJLvHCn_V-0ntOXSQfbRn0ULgb1-fDCWZ8oBbd_y9g@mail.gmail.com> In-Reply-To: <0dd5240f-6c70-425f-7e98-7946097ea3ef@metricspace.net> References: <0dd5240f-6c70-425f-7e98-7946097ea3ef@metricspace.net>
next in thread | previous in thread | raw e-mail | index | archive | help
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 =D0=B4=D0=B5=D0=BA. 2017 =D0=B3. 7:52 =D0=9F=D0=9F =D0=BF=D0=BE=D0=BB=D1= =8C=D0=B7=D0=BE=D0=B2=D0=B0=D1=82=D0=B5=D0=BB=D1=8C "Eric McCorkle" <eric@m= etricspace.net> =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=BB: > 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@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org= " >
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAF19XBL6yJLvHCn_V-0ntOXSQfbRn0ULgb1-fDCWZ8oBbd_y9g>