diff -rupN boost_1_60_0/boost/log/sources/record_ostream.hpp boost_1_60_0.new/boost/log/sources/record_ostream.hpp --- boost_1_60_0/boost/log/sources/record_ostream.hpp Sun Nov 15 14:47:43 2015 +++ boost_1_60_0.new/boost/log/sources/record_ostream.hpp Tue May 3 22:40:59 2016 @@ -252,8 +252,28 @@ struct stream_provider //! Log record stream adapter basic_record_ostream< char_type > stream; + //! Stream format flags + std::ios_base::fmtflags fmtflags; + + //! Stream precision + std::streamsize precision; + + //! Stream field width + std::streamsize width; + + //! Stream fill character + char_type fill; + //! Initializing constructor - explicit stream_compound(record& rec) : next(NULL), stream(rec) {} + explicit stream_compound(record& rec) : + next(NULL), + stream(rec), + fmtflags(stream.flags()), + precision(stream.precision()), + width(stream.width()), + fill(stream.fill()) + { + } }; //! The method returns an allocated stream compound diff -rupN boost_1_60_0/libs/log/src/record_ostream.cpp boost_1_60_0.new/libs/log/src/record_ostream.cpp --- boost_1_60_0/libs/log/src/record_ostream.cpp Sun Nov 15 14:47:43 2015 +++ boost_1_60_0.new/libs/log/src/record_ostream.cpp Tue May 3 22:40:59 2016 @@ -139,6 +139,13 @@ stream_provider< CharT >::allocate_compo stream_compound* p = pool.m_Top; pool.m_Top = p->next; p->next = NULL; + + // restore the original stream state saved at construction + p->stream.flags(p->fmtflags); + p->stream.precision(p->precision); + p->stream.width(p->width); + p->stream.fill(p->fill); + p->stream.attach_record(rec); return p; }