Boost logo

Boost :

From: Daniel Frey (d.frey_at_[hidden])
Date: 2005-04-30 01:00:53


Caleb Epstein wrote:
> On 4/29/05, Gennadiy Rozental <gennadiy.rozental_at_[hidden]> wrote:
>
>>"Darren Cook" <darren_at_[hidden]> wrote in message
>>news:4272B304.3000100_at_dcook.org...
>>
>>>>Another thing (from the same domain) that I found especially difficult to
>>>>deal with in my logging implementation is "intermixed logging":
>>>>
>>>>BOOST_LOG(..) << "Print result of f(): " << f();
>>>>
>>>>...
>>>>void f() {
>>>> BOOST_LOG(..) << "Enter f()";
>>>>...
>>>> BOOST_LOG(..) << "Exit f()";
>>>>}
>>>>
>>>>Now to make it properly formatter isn't trivial at all.
>>>
> 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.

Gennadiy, correct me if I'm wrong but as you wrote your post as a reply
to mine, I can see a connection: You seem to prefer the unbuffered
logging to have at least the partial information before an exception
occurs and to avoid complexity in the implementation of the logging
library by avoiding the buffering code, right?

FWIW, I think buffering should still be used, with an occasional
<<std::flush here and there. The main problem is, that it's not
sufficient to have a normal buffered stream (which usually has a
fixed-sized buffer), but to handle an unlimited buffer. This involves
memory managment, although I have to admit that the code I showed
"solves" this by moving the problem to the user's expression.

But then, maybe, I completely missed your point :)

Regards, Daniel


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk