Boost logo

Boost :

From: Rob Stewart (stewart_at_[hidden])
Date: 2004-03-18 16:34:28

From: "Neal D. Becker" <ndbecker2_at_[hidden]>
> John Torjo wrote:
> > Neal D. Becker wrote:
> >
> >>I notice boost doesn't have a logging library. I have seen several
> >>floating
> >>around. Are there any recommendations?
> >
> > How about std::ostream ;) ?
> >
> > Also, disabling writing to a stream is fairly easy, by setting the
> > failbit of a stream object:
> > out.setstate( std::ios::failbit); // nothing gets written to this log
> > any more
> Interesting idea. I would like the overhead of disabled loggers to be
> relatively small. Would you think this technique might be useful in that
> case? (Of course, relatively small is a relative term).

Every insertion and every mf you call on the stream must occur
and must check the failbit flag. It would, therefore, have
noticeable overhead. Is it a problem? Maybe. You could time an
app with the logging compiled away (via preprocessor) and with
the failbit set.

Rob Stewart                           stewart_at_[hidden]
Software Engineer           
Susquehanna International Group, LLP  using std::disclaimer;

Boost list run by bdawes at, gregod at, cpdaniel at, john at