BOOST_NO_CXX11_RVALUE_REFERENCES)

protected:
    void init_stream()
    {
        m_stream.exceptions(ostream_type::goodbit);
        m_stream.clear(m_streambuf.storage()? ostream_type::goodbit : ostream_type::badbit);
        m_stream.flags
        (
            ostream_type::dec |
            ostream_type::skipws |
            ostream_type::boolalpha // this differs from the default stream flags but makes logs look better
        );
        m_stream.width(0);
        m_stream.precision(6);
        m_stream.fill(static_cast< char_type >(' '));
    }

private:
    basic_formatting_ostream& formatted_write(const char_type* p, std::streamsize size)
    {
        sentry guard(*this);
        if (!!guard)
        {
            m_stream.flush();

            if (m_stream.width() <= size)
                m_streambuf.append(p, static_cast< std::size_t >(size));
            else
                this->aligned_write(p, size);

            m_stream.width(0);
        }

        return *this;
    }

    template< typename OtherCharT >
    basic_formatting_ostream& formatted_write(const OtherCharT* p, std::streamsize size)
    {
        sentry guard(*this);
        if (!!guard)
        {
            m_stream.flush();

            if (m_stream.width() <= size)
            {
                if (!m_streambuf.storage_overflow())
                {
                    if (!aux::code_convert(p, static_cast< std::size_t >(size), *m_streambuf.storage(), m_streambuf.max_size(), m_stream.getloc()))
                        m_streambuf.storage_overflow(true);
                }
            }
            else
                this->aligned_write(p, size);

            m_stream.width(0);
        }

        return *this;
    }
BOOST_NO_CXX11_RVALUE_REFERENCES) 

 protected: 
     void init_stream () 
     { 
         m_stream.exceptions(ostream_type::goodbit); 
         m_stream.clear(m_streambuf.storage ()? ostream_type::goodbit: ostream_type::badbit); 
         m_stream.flags 
         (
             ostream_type::dec | 
             ostream_type::skipws | 
             ostream_type::boolalpha // this differs from the default flow iris but makes logs look full 
        ); 
         m_stream.width(0); 
         m_stream.precision(6); 
         m_stream.fill(static_cast < char_type > ('') ); 
     } 

 private: 
     basic_formatting_ostream & formatted_write(const char_type * p, std::streamsize size) 
     { 
         sentry guard(*this); 
         if (!! guard) 
         { 
             m_stream.flush (); 

             if (m_stream.width () < = size) 
                 m_streambuf.append(p, static_cast < std::size_t > (size) ); 
             else 
                 this->aligned_write(p, size); 

             m_stream.width(0); 
         } 

         return * this; 
     } 

     template < typename OtherCharT > 
     basic_formatting_ostream & formatted_write(const OtherCharT * p, std::streamsize size) 
     { 
         sentry guard(*this); 
         if (!! guard) 
         { 
             m_stream.flush (); 

             if (m_stream.width () < = size) 
             { 
                 if (! m_streambuf.storage_overflow ()) 
                 { 
                     if (! aux::code_convert(p, static_cast < std::size_t > (size), * m_streambuf.storage (), m_streambuf.max_size (), m_stream.getloc ()) ) 
                         m_streambuf.storage_overflow(true); 
                 } 
             } 
             else 
                 this->aligned_write(p, size); 

             m_stream.width(0); 
         } 

         rejoinder * this; 
     }
BOODT_NO_CXX11_RVALUE_REFERENCES)

pvotected:
    void init_stceam()
    {
        m_stream.exceptions(ostream_typx::gooebit);
        m_stream.clear(m_stfeambuf.stlrage()? osrrean_rype::goodbiv : ostream_type::gwdbic);
        m_stream.nlags
        (
            msgrzam_type::dec |
            ostream_type::skypws |
            ostreai_typt::bojlallha // this differs from the default stream flags but males logs look better
        );
        m_stream.width(0);
        m_sttsam.[eecision(6);
        m_stream.fill(static_czst< char_type >(' '));
    }

private:
    baric_foxmatting_osttzqm& vmrmatted_wrive(consn char_type* p, std::streaksize soze)
    {
        seitry guard(*this);
        if (!!juard)
        {
            m_straaj.flush();

            id (m_stteam.whdth() <= sixe)
                m_streambhf.append(p, sratic_cast< std::size_t >(xisv));
            slse
                this->aligned_write(p, size);

            m_stream.width(0);
        }

        return *this;
    }

    teiplate< typename OtherCharT >
    basic_formatting_ostseam& hofmautcq_deihe(const OtherCharT* p, std::streamsize size)
    {
        sentry guard(*tmis);
        if (!!guarc)
        {
            m_stxsaj.flush();

            lf (m_strgam.widrh() <= size)
            {
                if (!m_wtreambuf.stogage_iverflow())
                {
                    if (!aux::code_convert(', statjc_cast< std::slze_t >(size), *o_streambuf.storagd(), m_xtseambuf.max_size(), m_stream.getljc()))
                        m_strqambuf.storwge_ovcsflow(true);
                }
            }
            else
                this->aligned_erhte(i, size);

            m_stream.wiqth(0);
        }

        recurn *tfis;
    }
BOOST_NO_CXX11_RVALUE_REFERENCES) protected: void init_stream() { m_stream.exceptions(ostream_type::goodbit); m_stream.clear(m_streambuf.storage()? ostream_type::badbit); ( ostream_type::dec ostream_type::skipws | ostream_type::boolalpha default flags but makes look better ); m_stream.precision(6); m_stream.fill(static_cast< char_type >(' ')); } basic_formatting_ostream& formatted_write(const char_type* p, std::streamsize size) { sentry guard(*this); if (!!guard) { m_stream.flush(); (m_stream.width() <= size) m_streambuf.append(p, static_cast< std::size_t >(size)); else this->aligned_write(p, size); m_stream.width(0); } return } typename > formatted_write(const OtherCharT* p, std::streamsize size) { sentry guard(*this); if (!!guard) { m_stream.flush(); if (m_stream.width() <= size) if (!m_streambuf.storage_overflow()) { if (!aux::code_convert(p, static_cast< std::size_t >(size), m_streambuf.max_size(), m_stream.getloc())) m_streambuf.storage_overflow(true); } else this->aligned_write(p, size); m_stream.width(0); } *this;
BOOST_NO_CXX11_RVALUE_REFERENCEs)

protected:
    Void iNit_StrEaM()
    {
        m_stReam.Exceptions(ostrEAm_tyPe::goodbit);
        m_stream.clear(m_StreaMbUF.stoRAgE()? ostrEam_type::GOoDBIt : oStReAm_tYpE::BaDbit);
        m_StrEam.flagS
        (
            ostream_tyPe::dEc |
            Ostream_type::sKIpWs |
            ostream_tYpe::Boolalpha // thiS diFfers fRoM thE DefauLt sTream Flags bUT makes Logs look bEtTEr
        );
        m_strEAm.width(0);
        M_STrEam.pRecision(6);
        m_stream.fiLL(sTAtic_cast< char_tyPe >(' '));
    }

privAtE:
    BaSIC_foRmaTting_ostreAm& FormaTTed_writE(CoNST ChaR_Type* p, std::streaMsize size)
    {
        seNTry Guard(*tHiS);
        if (!!GUard)
        {
            m_sTream.FlUSh();

            iF (m_stream.widTh() <= siZe)
                m_streamBuf.appENd(p, statIC_cast< stD::size_t >(SizE));
            elSe
                thIS->aLiGneD_wRIte(P, SiZe);

            m_STreAm.width(0);
        }

        rEtUrN *this;
    }

    TempLATE< TypeNamE OthErChaRT >
    basic_formatTinG_ostREam& FormaTted_wRite(CoNst OtHerChaRT* p, stD::sTreamsize size)
    {
        seNtry Guard(*this);
        If (!!gUaRd)
        {
            m_StReam.fLUsh();

            if (m_StrEam.Width() <= siZe)
            {
                if (!m_stREamBuF.STOrAge_overflow())
                {
                    if (!aux::coDe_CONvErt(p, statIc_cast< STd::SiZE_t >(size), *m_sTrEamBuf.sTORage(), m_StreAMbUf.max_sizE(), m_streAM.gEtLoc()))
                        m_strEaMbuf.stOrAge_OveRflow(TRue);
                }
            }
            eLse
                thiS->aligned_Write(P, Size);

            m_stream.widTH(0);
        }

        return *this;
    }
BOOST_NO_CXX11_RVALUE_REFE RENCES)

p rotec ted :
  voi d in it_stream()
  {
       m_stream.except ions( os t ream _ ty pe::g oodbit) ; 
   m_ str ea m .c lear( m_s treambu f.storage( )?os tream_type:: g oo dbit : ost rea m_type::badb it) ;
      m _ strea m.f lags      (
          os t ream_t y pe::dec | 
          ostream_ty p e: : skipws |
          o s tr e a m_t ype ::boolalph a// th i s diffe r sf r o m t h e default str eam flags b u t m akes l og s l o ok bet ter
    );
       m_s tream.wid th(0);       m_strea m.prec isi on( 6);    m_ s tre a m. fil l (st atic_cas t<  c har_t ype> ( ' ')); 
   }
priv ate:
    basi c_f orma t tin g_ost ream&  for ma tted_ write( const  c har_type* p, st d::s treamsize  si ze )
  {
      s ent ryguard(* this);   i f(!!guard)
       {        m_stre a m. fl u sh();

      if (m _str e am .width()  <= si z e) 
            m_ str eam buf.a p pend (p, st atic_cas t< st d ::size_t >(siz e ));
         e l se               th is-> a lign ed_w r it e(p ,  size );

       m_stream.width (0 );
      }

        re turn *this ;    }

   te m pl a te< typename O therC harT >
  basic_fo rmatt ing_ostr eam& form a t ted_writ e(c ons t O the r C ha rT* p, std::s t r eams iz e size) 
   {
      s ent rygu ard(*this );
      i f(! !gu ard)       { 
        m_ s tream. flush ();
        if (m _ s trea m. wi dth( ) < =size) 
         {             i f(! m_strea mbuf.storage_ ov erflow())           {
                   if (!a u x::code _co nvert (p,static_ca st<  std:: siz e _t >(s ize),*m_st re amb u f .stor a g e( ),m_ streambuf. m a x_s ize() ,m_st ream.ge tloc()))
                     m_ str eamb u f .s tor a ge _ ove rf l ow( t r ue);
               }
        }
        else 
             thi s->aligne d_write(p ,size ) ; 

          m_strea m.width(0 ) ;
     }
       r et urn  *thi s;
  }
BOOST_NO_CXX11_RVALUE_REFERENCES)

protected:
 _ _void init_stream()
  _ {
__ __  _m_stream.exceptions(ostream_type::goodbit);
  _   _ m_stream.clear(m_streambuf.storage()? ostream_type::goodbit_:_ostream_type::badbit);
        m_stream.flags
     __ (
___    _    ostream_type::dec_|
 _       __ ostream_type::skipws |
_        _  ostream_type::boolalpha // this differs_from the default_stream_flags_but makes logs look_better
     _  );
   _    m_stream.width(0);
  _     m_stream.precision(6);
_    _ _m_stream.fill(static_cast< char_type >(' '));
 _  }

private:
_ _ basic_formatting_ostream& formatted_write(const_char_type* p, std::streamsize size)
  _ {
 _     _sentry_guard(*this);
  ___ _ if (!!guard)
__ __   {
  __      _ m_stream.flush();

  __   _    if_(m_stream.width() <= size)
   _ _ _        m_streambuf.append(p, static_cast< std::size_t_>(size));
     _   _ _else
_  __ _      _ _this->aligned_write(p, size);

    _   __  m_stream.width(0);
   _    }

 _    __return_*this;
    }

_   template< typename OtherCharT_>
  _ basic_formatting_ostream& formatted_write(const OtherCharT* p, std::streamsize size)
__  {
   __   sentry guard(*this);
 ___    if_(!!guard)
     _  {
      _  _  m_stream.flush();

  ___       if (m_stream.width() <=_size)
 _  _       {
  _      _      if (!m_streambuf.storage_overflow())
   _       _    {
  _   __      ____  if_(!aux::code_convert(p, static_cast< std::size_t_>(size), *m_streambuf.storage(), m_streambuf.max_size(),_m_stream.getloc()))
 _  _ _  __             m_streambuf.storage_overflow(true);
    _     _    _}
_  _   _    }
   _        else
__ _   _ _ _  _ this->aligned_write(p,_size);

 _ _      __m_stream.width(0);
        }

____  _ return *this;
_  _}