util/logging.cc
/// Log to files, rotating at midnight daily or if the size grows to
/// more than 5MB.  file_pattern indicates the log filename pattern.
/// autoflush this backend so we can capture errors asap
///
Log to files, rotating at midnight daily or if the size grows to
more than 5MB.  file_pattern indicates the log filename pattern.
autoflush this backend so we can capture errors asap
Log to files rotating at midnight daily or if the size grows to more than 5MB . file_pattern indicates the log filename pattern . autoflush this backend so we can capture errors asap
static void
init_file_logging( boost::shared_ptr< logging::core > core,
                   const char* file_pattern )
{
    boost::shared_ptr< sinks::text_file_backend > backend =
        boost::make_shared< sinks::text_file_backend >(
            keywords::file_name = file_pattern,
            keywords::rotation_size = (5 * 1024 * 1024),
            keywords::time_based_rotation
               = sinks::file::rotation_at_time_point(0, 0, 0)
            );
    backend->auto_flush(true);
    boost::shared_ptr< sink_t > sink(new sink_t(backend));
    init_file_collecting(sink);
    sink->locked_backend()->scan_for_files();
    sink->set_formatter(&rlog_formatter);
    core->add_sink(sink);
}
static void init_file_logging ( boost :: shared_ptr < logging :: core > core , const char * file_pattern ) { boost :: shared_ptr < sinks :: text_file_backend > backend = boost :: make_shared < sinks :: text_file_backend > ( keywords :: file_name = file_pattern , keywords :: rotation_size = ( 5 * 1024 * 1024 ) , keywords :: time_based_rotation = sinks :: file :: rotation_at_time_point ( 0 , 0 , 0 ) ) ; backend -> auto_flush ( true ) ; boost :: shared_ptr < sink_t > sink ( new sink_t ( backend ) ) ; init_file_collecting ( sink ) ; sink -> locked_backend ( ) -> scan_for_files ( ) ; sink -> set_formatter ( & rlog_formatter ) ; core -> add_sink ( sink ) ; }
Log to files, rotating at midnight daily or if the size grows to
more than 5MB.
Log to files rotating at midnight daily or if the size grows to more than 5MB .
// Flush after every log message--not clear this is effective... // Wrap it into the frontend and register in the core. // The backend requires synchronization in the frontend. // Upon restart, scan the directory for files matching file_pattern // Add a formatter