
14 Mar
2010
14 Mar
'10
7:10 p.m.
On 03/14/2010 09:50 PM, Tom Brinkman wrote:
You coud probably fix all my concerns by adding something like the following.
Notice that there are no macros, no templates, its header file only and it does not require any other boost libraries.
Usage: boost::error("An Error has occured: %s\n", "Put message here");
I'd say that interface is very limited and unsafe. But if you like it, you can write a wrapper header around Boost.Log in the following style: void error (const char *format, ...) { va_list args; va_start (args, format); char buf[1024]; vsnprintf(buf, sizeof(buf), format, args); va_end (args); BOOST_LOG_TRIVIAL(error) << buf; }