|
Boost : |
From: Gennadiy Rozental (gennadiy.rozental_at_[hidden])
Date: 2005-05-04 09:13:19
"John Torjo" <john.lists_at_[hidden]> wrote in message
news:42788C90.9050504_at_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.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk