Boost logo

Boost :

Subject: Re: [boost] boost log to display source code name and lines
From: Andrey Semashev (andrey.semashev_at_[hidden])
Date: 2018-12-28 08:24:58

On 12/28/18 10:42 AM, hh h wrote:
> I'd like to run a macro which can display file name and code lines by
> calling LOG(debug) << "debug here"; the following example answered Mar
> 10 '16 at 8:50 by jma looks good, but I could not compile it, I am
> running on ubuntu 18 that the boost version is 1.65:
> error: no matching function for call to
> ‘boost::log::v2_mt_posix::core::add_sink(std::shared_ptr<boost::log::v2_mt_posix::sinks::synchronous_sink<boost::log::v2_mt_posix::sinks::text_file_backend>
>> &)’
> logging::core::get()->add_sink(sink);

Boost.Log uses boost::shared_ptr, not std::shared_ptr.

> Another one in following link even got more errors I won't be bothered to post.
> error: missing template arguments before ‘logger’
> boost::log::sources::severity_logger_mt logger;
> ......

The quoted code sample in the linked blog page is indeed missing
template arguments in a few places. The original code on GitHub
( seems to be better, although
I didn't try to compile it. I guess, some parts got lost in the blog due
to missing HTML escaping.

PS: Don't top-post, please.

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