Subject: Re: [boost] [log] Boost.Log formal review
From: Daniel Larimer (dlarimer_at_[hidden])
Date: 2010-03-12 13:23:09
On Mar 12, 2010, at 6:53 AM, Stewart, Robert wrote:
> The solution is for libraries that wish to communicate such information -- which would otherwise be logged by the library -- via a callback API. Such an API is reasonably within the scope of Boost.Log (even if that turns out to not be Andrey's library). IOW, Boost.Log can define an API and some functionality to standardize the mechanism for reporting information that would be logged, such that an application can tie that reporting into any logging system.
> Thus, Boost libraries should not log via Boost.Log but should report loggable information via a Boost.Log-provided callback API that can be connected to Boost.Log or any other logging library of the application's choice. Then, all Boost libraries that wish to report loggable information use one API for reporting and an application makes just one call to connect them all to its preferred logging library.
This is how I designed our own internal logging system. Components that wish to log emit a signal that the logging service can connect to. The critical part of such a system is the ability to determine whether anyone is listening before incurring the expense of calculating/formatting/serializing data for the log. Signals are my preferred callback mechanism because it allows multiple logging services to be running.
Of course all signals are exposed via RPC so a logging service can connect over the network.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk