Boost logo

Boost :

From: Rob Stewart (stewart_at_[hidden])
Date: 2005-05-04 11:46:21


From: Caleb Epstein <caleb.epstein_at_[hidden]>
>
> If one uses the supplied write_to_file appender, the messages will be
> written to the output file as soon as they are complete. So for
> example,
>
> BOOST_LOG(debug) << "Wrote " << len << " bytes to socket fd " << fd;
>
> would write a single message like "Wrote 56 bytes to socket 3" or
> nothing at all (e.g. if the application crashed sometime in the middle
> of formatting the message). I think this is eminently reasonable and
> hardly "useless".

The point is not so clear if the expression following BOOST_LOG()
includes side effects that cause the application to crash, for
example.

If the stream provided by BOOST_LOG() were unbuffered, then
output would be flushed as soon as it was formatted, so you'd get
output up until the point of the crash. Any buffering means that
the buffered output is lost when the app crashes.

-- 
Rob Stewart                           stewart_at_[hidden]
Software Engineer                     http://www.sig.com
Susquehanna International Group, LLP  using std::disclaimer;

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