Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Prev Previous commit
Next Next commit
statement-distribution: extract log target into a const
  • Loading branch information
ordian committed Sep 30, 2020
commit 45f3f833d307749ec3756ca9917b75a2fa2a763f
6 changes: 4 additions & 2 deletions node/network/statement-distribution/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ const BENEFIT_VALID_STATEMENT_FIRST: Rep = Rep::new(
/// Typically we will only keep 1, but when a validator equivocates we will need to track 2.
const VC_THRESHOLD: usize = 2;

const LOG_TARGET: &str = "statement_distribution";

/// The statement distribution subsystem.
pub struct StatementDistribution;

Expand Down Expand Up @@ -812,7 +814,7 @@ async fn handle_network_update(

for new in our_view.difference(&old_view) {
if !active_heads.contains_key(&new) {
log::warn!(target: "statement_distribution", "Our network bridge view update \
log::warn!(target: LOG_TARGET, "Our network bridge view update \
inconsistent with `StartWork` messages we have received from overseer. \
Contains unknown hash {}", new);
}
Expand Down Expand Up @@ -862,7 +864,7 @@ async fn run(
(Ok(v), Ok(s)) => (v, s),
(Err(e), _) | (_, Err(e)) => {
log::warn!(
target: "statement_distribution",
target: LOG_TARGET,
"Failed to fetch runtime API data for active leaf: {:?}",
e,
);
Expand Down