Boost logo

Boost Users :

Subject: [Boost-users] Inability to print LINE, FILE, FUNCTION in Boost.Log?
From: Robert Dailey (rcdailey.lists_at_[hidden])
Date: 2015-08-05 10:30:54

I find the simplest things the most frustrating to accomplish in
Boost.Log. I know that some compilers have predefined preprocessor
macros to provide information. MSVC for example has __LINE__,
__FILE__, etc.

I need Boost.Log to print line, file, and function information for me
in a platform agnostic way. The documentation is not easy to navigate
through and find the information I need. Also examples on this are
sparse. I've seen some people calling BOOST_LOG_NAMED_SCOPE manually
prior to each log statement. This seems unintuitive.

How can I simply print this contextual information with each log line
in an automated way? Can't Boost.Log piggy-back on compiler features
available to it?

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at