mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 10:31:03 +00:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user