New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log console output during replay to file #985 #1355

Merged
merged 3 commits into from Oct 2, 2018

Conversation

Projects
3 participants
@cogutvalera
Member

cogutvalera commented Oct 1, 2018

PR for #985 "Log console output during replay to file"

bump fc and changed (std::cerr) to (ilog) in application.cpp and witness.cpp

}
if( modified_genesis )
{
std::cerr << "WARNING: GENESIS WAS MODIFIED, YOUR CHAIN ID MAY BE DIFFERENT\n";
ilog("WARNING: GENESIS WAS MODIFIED, YOUR CHAIN ID MAY BE DIFFERENT\n");

This comment has been minimized.

@pmconrad

pmconrad Oct 1, 2018

Please use wlog here

This comment has been minimized.

@cogutvalera

cogutvalera Oct 1, 2018

Member

ok sure ! Thanks !

@@ -982,16 +985,18 @@ void application::initialize(const fc::path& data_dir, const boost::program_opti
try {
genesis_state = fc::json::from_file(genesis_out).as<genesis_state_type>( 20 );
} catch(const fc::exception& e) {
std::cerr << "Unable to parse existing genesis file:\n" << e.to_string()
<< "\nWould you like to replace it? [y/N] ";
ilog(

This comment has been minimized.

@pmconrad

pmconrad Oct 1, 2018

This prompts for user input, please change back to original.

This comment has been minimized.

@cogutvalera

cogutvalera Oct 1, 2018

Member

ok sure ! Thanks !

if( db.get_slot_at_time( fc::time_point::now() ) > 200 )
{
std::cerr << "Your genesis seems to have an old timestamp\n"
ilog("Your genesis seems to have an old timestamp\n"

This comment has been minimized.

@pmconrad

pmconrad Oct 1, 2018

Please change to wlog.

This comment has been minimized.

@cogutvalera

cogutvalera Oct 1, 2018

Member

ok sure ! Thanks !

}
if( _options->count("dbg-init-key") )
{
std::string init_key = _options->at( "dbg-init-key" ).as<string>();
FC_ASSERT( genesis.initial_witness_candidates.size() >= genesis.initial_active_witnesses );
set_dbg_init_key( genesis, init_key );
modified_genesis = true;
std::cerr << "Set init witness key to " << init_key << "\n";
ilog("Set init witness key to ${init_key}\n", ("init_key", init_key));

This comment has been minimized.

@abitmore

abitmore Oct 1, 2018

Member

\n is not needed in ilog.

This comment has been minimized.

@cogutvalera

cogutvalera Oct 1, 2018

Member

fixed in new commit. Thanks !

ilog(
"Used genesis timestamp: ${timestamp} (PLEASE RECORD THIS)\n",
("timestamp", genesis.initial_timestamp.to_iso_string())
);

This comment has been minimized.

@abitmore

abitmore Oct 1, 2018

Member

\n is not needed in ilog.

This comment has been minimized.

@cogutvalera

cogutvalera Oct 1, 2018

Member

fixed in new commit. Thanks !

@@ -989,9 +992,9 @@ void application::initialize(const fc::path& data_dir, const boost::program_opti
return;
}
std::cerr << "Updating genesis state in file " << genesis_out.generic_string() << "\n";
ilog("Updating genesis state in file ${genesis_out} \n", ("genesis_out", genesis_out.generic_string()));

This comment has been minimized.

@abitmore

abitmore Oct 1, 2018

Member

I don't think here and below should be changed to ilog. @pmconrad what's your opinion?

This comment has been minimized.

@cogutvalera

cogutvalera Oct 1, 2018

Member

fixed in new commit. Thanks !

if( db.get_slot_at_time( fc::time_point::now() ) > 200 )
{
std::cerr << "Your genesis seems to have an old timestamp\n"
wlog("Your genesis seems to have an old timestamp\n"

This comment has been minimized.

@abitmore

abitmore Oct 1, 2018

Member

Personally I think having \n in the middle of a log message is a bit strange. What's your opinion?

This comment has been minimized.

@cogutvalera

cogutvalera Oct 1, 2018

Member

fixed in new commit. Thanks !

}
if( modified_genesis )
{
std::cerr << "WARNING: GENESIS WAS MODIFIED, YOUR CHAIN ID MAY BE DIFFERENT\n";
wlog("WARNING: GENESIS WAS MODIFIED, YOUR CHAIN ID MAY BE DIFFERENT\n");

This comment has been minimized.

@abitmore

abitmore Oct 1, 2018

Member

\n is not needed.

This comment has been minimized.

@cogutvalera

cogutvalera Oct 1, 2018

Member

fixed in new commit. Thanks !

@abitmore abitmore added this to In progress in Feature release (201810) via automation Oct 1, 2018

@abitmore abitmore added this to the 201810 - Feature Release milestone Oct 1, 2018

Feature release (201810) automation moved this from In progress to In Testing Oct 2, 2018

@pmconrad

Thanks!

@pmconrad pmconrad merged commit 85ac4c0 into bitshares:develop Oct 2, 2018

2 checks passed

ci/dockercloud Your tests passed in Docker Cloud
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

Feature release (201810) automation moved this from In Testing to Done Oct 2, 2018

@cogutvalera

This comment has been minimized.

Member

cogutvalera commented Oct 2, 2018

Thanks !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment