Boost logo

Boost Users :

From: Benjamin de Dardel (benjamin.dedardel_at_[hidden])
Date: 2007-12-13 08:43:18


Hi John, hi all

As I don't know how to parameter boost::logging to flush messages in
rolling files, I modify the code as follow.

My question is :
Is it absolutly necessary to change the code to do that ?

Thanks,
Benjamin

///// rolling_file.hpp ///////

    void recreate_file() {...
                m_cur_size = 0;
     }

    template<class msg_type> void write( const msg_type& msg) {
        convert_dest::write(msg, (*m_out) );

        // flush each time
        m_cur_size += msg.size();
        m_out->flush();
        if ( m_cur_size > m_flags.max_size_bytes()) {
            m_cur_idx = (m_cur_idx + 1) % m_flags.file_count();
            recreate_file();
        }
    }

    size_t m_cur_size;

//////////////////////////////////////

John Torjo a écrit :
> Hi Benjamin,
>
>> Hi all,
>>
>>
>>
> Glad you posted this here :)
>
>> Does anybody use boost::logging ?
>>
>> I wonder if it's possible to flush logs in a rolling_file as in a
>> standard file (flush_each_time) ?
>> It would be nice !
>>
>>
>>
> Yes it would, and it can ;)
>
>
> Best,
> John
>
>
>
>
>


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net