
"John Torjo" <john.lists@torjo.com> wrote in message news:42788C90.9050504@torjo.com...
a.cpp:14: Print result of f(): b.cpp:75: Enter f() b.cpp:95: Exit f() a.cpp:14: 1234
I really don't understand why you'd want this. And more to the point, I'm really curious how you could implement this in C++:
It's a bit ricky. But doable.
// show what you want above. BOOST_LOG(app) << "result of f() " << f();
And finally, I don't know why you'd want the above. What if f() then calls g(), and so on, all this functions doing some logging. Would you actually prefer:
a.cpp:14: result of f() [100 lines of other logged messages] a.cpp:14: 1234
To:
[100 lines of other logged messages] a.cpp:14: result of f(): 1234
Yes. I would. Because it's an actual program flow. Would it be int r = f(); BOOST_LOG(app) << "result of f() " << r; I definitely would like to see a second. Gennadiy. Gennadiy.