[Boost-bugs] [Boost C++ Libraries] #10061: boost::log (boost logging): BOOST_LOG_FUNCTION works only in main thread

Subject: [Boost-bugs] [Boost C++ Libraries] #10061: boost::log (boost logging): BOOST_LOG_FUNCTION works only in main thread
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2014-05-20 11:13:57


#10061: boost::log (boost logging): BOOST_LOG_FUNCTION works only in main thread
------------------------------+---------------------
 Reporter: anonymous | Owner: andysem
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: log
  Version: Boost 1.54.0 | Severity: Problem
 Keywords: |
------------------------------+---------------------
 Consider the following function:

 {{{
 void thread()
 {
     BOOST_LOG_FUNCTION();

     while(true) {
         // Create log entry
     }
 }
 }}}

 If I just call "thread()" within main() as a function my log entries
 created in "thread()" look as expected:


 {{{
 [void __cdecl thread(void) (c:\...\maintest.cpp:16)]
 }}}


 However if you use "thread()" within main() as a real thread:
 {{{
  boost::thread t(thread);
 }}}
 the appropriate log-entry containing the scope is empty:

 {{{
 []
 }}}

 Code snippet:


 {{{
 keywords::format = expr::stream
 << "[" << expr::format_named_scope("Scope", keywords::format = "%n
 (%f:%l)")<< "] "
 }}}

 I do not understand this, since the appropriate values '''__FUNCTION__'''
 and '''__FUNCSIG__''' are always available when manually printed.
 Operating system: Windows 7. I posted the issue without a solution on
 stackoverflow a few months ago so that I assume it is a bug:

 http://stackoverflow.com/questions/19893181/boostlog-boost-logging-boost-
 log-function-only-works-in-main-thread

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/10061>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:16 UTC