
a.cpp:14: Print result of f(): b.cpp:75: Enter f() b.cpp:95: Exit f() a.cpp:14: 1234
The proposed implementation yields this (modulo any prefixes):
Enter f() Exit f() Print result of f(): 1234
Because each message is built up in a temporary stream and then fired off to the logger in its entirety.
Gennadiy: to do what you suggest would seem to me to require (a) no buffering and (b) an interface which is likely not thread-safe. Or am I missing something.
Sorry. I am not that deep ;)) First of all I am not familiar with detail of this submission and second I just talking from user prospective. And from that prospective what proposed implementation yields may not be ucceptable cause it break order of events. I wonder what it's going to pring in more complicated cases: BOOST_LOG(..) << "Print result of f(): " << f() << " and g()" << g(); void f() { BOOST_LOG(..) << "Enter f()"; BOOST_LOG(..) << "f() inside uses m(): " << m(); BOOST_LOG(..) << "Exit f()"; } void g() { BOOST_LOG(..) << "Enter g()"; BOOST_LOG(..) << "g() inside uses m(): " << m(); BOOST_LOG(..) << "Exit g()"; } Gennadiy P.S. Could you explain a bit more how cashing and threading are involved here