babe, grandpa: restrict info logging during initial sync (#5564)

* babe: restrict info logging during initial sync

* grandpa: restrict info logging during initial sync

* grandpa: fix test compilation

* grandpa: remove afg_log macro mod
This commit is contained in:
André Silva
2020-04-07 21:11:22 +01:00
committed by GitHub
parent 6a87e1d1af
commit 1a9c0fee30
6 changed files with 147 additions and 53 deletions
@@ -84,6 +84,23 @@ use std::time::Duration;
use std::pin::Pin;
use std::task::{Poll, Context};
// utility logging macro that takes as first argument a conditional to
// decide whether to log under debug or info level (useful to restrict
// logging under initial sync).
macro_rules! afg_log {
($condition:expr, $($msg: expr),+ $(,)?) => {
{
let log_level = if $condition {
log::Level::Debug
} else {
log::Level::Info
};
log::log!(target: "afg", log_level, $($msg),+);
}
};
}
mod authorities;
mod aux_schema;
mod communication;