Add logging to simulation example.

This commit is contained in:
Andreas Fackler 2018-05-31 14:27:55 +02:00
parent f970272d3e
commit fc599232aa
2 changed files with 7 additions and 0 deletions

View File

@ -1,6 +1,7 @@
extern crate bincode;
extern crate colored;
extern crate docopt;
extern crate env_logger;
extern crate hbbft;
extern crate itertools;
extern crate rand;
@ -394,6 +395,7 @@ fn parse_args() -> Result<Args, docopt::Error> {
}
fn main() {
env_logger::init();
let args = parse_args().unwrap_or_else(|e| e.exit());
if args.flag_n <= 3 * args.flag_f {
let msg = "Honey Badger only works if less than one third of the nodes are faulty.";

View File

@ -111,6 +111,11 @@ impl<NodeUid: Clone + Debug + Eq + Hash + Ord> DistAlgorithm for CommonSubset<No
type Error = Error;
fn input(&mut self, input: Self::Input) -> CommonSubsetResult<()> {
debug!(
"{:?} Proposing {:?}",
self.netinfo.our_uid(),
HexBytes(&input)
);
self.send_proposed_value(input)
}