Boost logo

Boost Users :

From: Brad (boost_at_[hidden])
Date: 2008-03-08 00:09:52


Hello all,

First post so be gentle with me :-)

OK, I've been playing around with revision 43544 of boost::logging using
the following code;

#include <boost/logging/format.hpp>
#include <boost/logging/format/formatter/tags.hpp>
#include <boost/logging/format/destination/syslog.hpp>

// uncomment if you're using Named Formatters and Destinations
// #include <boost/logging/format/named_write.hpp>

using namespace boost::logging;

typedef boost::logging::logger_format_write< > log_type;
BOOST_DEFINE_LOG(g_l, log_type)
BOOST_DEFINE_LOG_FILTER(g_l_filter, boost::logging::level::holder)
#define LAPP_ BOOST_LOG_USE_LOG_IF_LEVEL(g_l(), g_l_filter(), info )

int main( void )
{

g_l()->writer().add_destination( destination::cout() );
g_l()->writer().add_destination( destination::syslog_no_levels() );
LAPP_ << "hi";

}

when I compile it with "g++ -o syslog_test syslog_test.cpp
-I/usr/include/ -lpthread"

I get the following errors:

/usr/include/boost/logging/format/destination/syslog.hpp:61: error:
‘level’ is not a member of ‘boost::logging::formatter’
/usr/include/boost/logging/format/destination/syslog.hpp:61: error:
‘level’ is not a member of ‘boost::logging::formatter’
/usr/include/boost/logging/format/destination/syslog.hpp:61: error:
template argument 1 is invalid

A quick look in boost/logging/format/formatter/tags.hpp and I see a
typedef for level but no actual definition.

If I change line 61 from:
struct syslog : is_generic, formatter::uses_tag< formatter::level,
::boost::logging::tag::level >, boost::logging::op_equal::always_equal {

to:
struct syslog : is_generic, formatter::uses_tag<
boost::logging::tag::level, ::boost::logging::tag::level >,
boost::logging::op_equal::always_equal {

It compiles and appears to work fine (I don't claim to understand the
effects of this change). Forgive me if I'm missing something obvious or
wasting anyones time.
I'm thinking this is a bug but there's a high percentage chance it's an
error on my part lol.

Anyway, I'm having some great fun with boost (asio and logging so far)
and appreciate the work some of you guys have put into these libs.

Thanks,
Brad


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net