
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:
https://stackoverflow.com/questions/35895199/boost-log-and-severity-local-at...
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.
http://gernotklingler.com/blog/simple-customized-logger-based-boost-log-v2/
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 (https://github.com/gklingler/simpleLogger) 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.