Boost logo

Boost :

Subject: [boost] Boost.logging bugs
From: Dmitriy Lyfar (dlyfar_at_[hidden])
Date: 2009-06-06 08:57:53


We are using boost.logging library in our project. We prefered that library
because of header-only structure and
it looks great. But recently I have found some two bugs.
First of them its crash while output in syslog. I found that

    template<class msg_type> void operator()(const msg_type & msg) const {
        syslog( LOG_INFO, msg.c_str() );

looks incorrect, because second argument is format string, so next line lead
boost.logging to crash:

(I need output some html parts in syslog like debug info). So I replaced
code above with:

    template<class msg_type> void operator()(const msg_type & msg) const {
        syslog( LOG_INFO, "%s", msg.c_str() );

Which works correct, but it seems not general solution. What do you think?
And the second one is compiling under gcc 3.4.6 issue:

In member function `void
msg_type&) const [with msg_type = std::basic_string<char,
std::char_traits<char>, std::allocator<char> >, convert_dest =

instantiated from `void
manipulator_base>::operator()(typename manipulator_base::param) const [with
generic_type =
manipulator_base =

LMLog.cpp:219: instantiated from here
error: expected primary-expression

That can be fixed by pointing template keyword before operator() calling:

        virtual void operator()(param val) const {
            m_val.template operator()(val);


        virtual void operator()(param val) const {

Thank you for such library, I'm waiting for your comments.

Regards, Dmitriy Lyfar.

Boost list run by bdawes at, gregod at, cpdaniel at, john at