Boost logo

Boost Users :

Subject: Re: [Boost-users] [log] translating 3rd party logging messages
From: Olaf Peter (ope-devel_at_[hidden])
Date: 2014-07-16 11:52:30


> as far I understood so far, the entry point is described at
> http://www.boost.org/doc/libs/1_54_0/libs/log/doc/html/log/detailed/sources.html.
>
> if (logging::record rec = m_logger.open_record())
> {
> rec.attribute_values().insert("Message",
> attrs::make_attribute_value(std::string("Connection established")));
> m_logger.push_record(boost::move(rec));
> }
>
>
> where I can write a record with Message and LineID. But what is the
> complementary attribute for Filename and Function??
>
a little bit further, but even failed to compile:

// from qt logger context
     int ctx_line =42;
     const char *ctx_file = "the_file.cpp";
     const char *ctx_function = "the_function";

// string_literal expected
// errror: no matching function for call to
'boost::log::v2s_mt_posix::attributes::named_scope_entry::named_scope_entry(const
char* const&, const char* const&, const int&)'
// how to convert ??
attributes::named_scope_entry scope(ctx_function, ctx_file, ctx_line);

// error: no matching function for call to
'boost::log::v2s_mt_posix::attribute_value_set::insert(const char [6],
boost::log::v2s_mt_posix::attributes::named_scope_entry&)'
record.attribute_values().insert("Scope", scope);

The first lacks probably my missing knowledge about const char* and
const char[], isn't it?

Thanks,
Olaf


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