Skip to content

Commit

Permalink
Log console output during replay to file #985 (2nd simpler solution)
Browse files Browse the repository at this point in the history
  • Loading branch information
cogutvalera committed Sep 21, 2018
1 parent 43b1f11 commit c720d64
Showing 1 changed file with 7 additions and 21 deletions.
28 changes: 7 additions & 21 deletions src/log/file_appender.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,13 @@ namespace fc {
public:
impl( const config& c) : cfg( c )
{
if( cfg.rotate )
{
FC_ASSERT( cfg.rotation_interval >= seconds( 1 ) );
FC_ASSERT( cfg.rotation_limit >= cfg.rotation_interval );



if( cfg.rotate )
{
FC_ASSERT( cfg.rotation_interval >= seconds( 1 ) );
FC_ASSERT( cfg.rotation_limit >= cfg.rotation_interval );

_rotation_task = fc::async( [this]() { rotate_files( true ); }, "rotate_files(1)" );
}
rotate_files( true );
}
}

~impl()
Expand Down Expand Up @@ -137,18 +134,7 @@ namespace fc {
file_appender::file_appender( const variant& args ) :
my( new impl( args.as<config>( FC_MAX_LOG_OBJECT_DEPTH ) ) )
{
try
{
fc::create_directories(my->cfg.filename.parent_path());

if(!my->cfg.rotate)
my->out.open( my->cfg.filename, std::ios_base::out | std::ios_base::app);

}
catch( ... )
{
std::cerr << "error opening log file: " << my->cfg.filename.preferred_string() << "\n";
}

}

file_appender::~file_appender(){}
Expand Down

0 comments on commit c720d64

Please sign in to comment.