FC Updates from BitShares and myself #21

Closed
nathanielhourt wants to merge 687 commits from dapp-support into latest-fc
Showing only changes of commit fa7faee633 - Show all commits

View file

@ -34,21 +34,20 @@ namespace fc {
public: public:
impl( const config& c) : cfg( c ) impl( const config& c) : cfg( c )
{ {
try
{
fc::create_directories(cfg.filename.parent_path());
if( cfg.rotate ) if( cfg.rotate )
{ {
FC_ASSERT( cfg.rotation_interval >= seconds( 1 ) ); FC_ASSERT( cfg.rotation_interval >= seconds( 1 ) );
FC_ASSERT( cfg.rotation_limit >= cfg.rotation_interval ); FC_ASSERT( cfg.rotation_limit >= cfg.rotation_interval );
rotate_files( true ); rotate_files( true );
} } else {
try
{
fc::create_directories(cfg.filename.parent_path());
if(!cfg.rotate)
out.open( cfg.filename, std::ios_base::out | std::ios_base::app); out.open( cfg.filename, std::ios_base::out | std::ios_base::app);
} }
}
catch( ... ) catch( ... )
{ {
std::cerr << "error opening log file: " << cfg.filename.preferred_string() << "\n"; std::cerr << "error opening log file: " << cfg.filename.preferred_string() << "\n";