-
Notifications
You must be signed in to change notification settings - Fork 649
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
Conversation
libraries/app/application.cpp
Outdated
} | ||
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"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use wlog here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok sure ! Thanks !
libraries/app/application.cpp
Outdated
@@ -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( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This prompts for user input, please change back to original.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please change to wlog.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok sure ! Thanks !
libraries/app/application.cpp
Outdated
} | ||
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)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
\n
is not needed in ilog
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed in new commit. Thanks !
ilog( | ||
"Used genesis timestamp: ${timestamp} (PLEASE RECORD THIS)\n", | ||
("timestamp", genesis.initial_timestamp.to_iso_string()) | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
\n
is not needed in ilog
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed in new commit. Thanks !
libraries/app/application.cpp
Outdated
@@ -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())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think here and below should be changed to ilog
. @pmconrad what's your opinion?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Personally I think having \n
in the middle of a log message is a bit strange. What's your opinion?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed in new commit. Thanks !
libraries/app/application.cpp
Outdated
} | ||
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"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
\n
is not needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed in new commit. Thanks !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Thanks ! |
PR for #985 "Log console output during replay to file"
bump fc and changed (std::cerr) to (ilog) in application.cpp and witness.cpp