Use LOG_TARGET in consensus related crates (#12875)

* Use shared LOG_TARGET in consensus related crates
* Rename target from "afg" to "grandpa"
This commit is contained in:
Davide Galassi
2022-12-14 14:56:17 +01:00
committed by GitHub
parent 3e0a1904b7
commit 391adaf443
31 changed files with 343 additions and 247 deletions
@@ -20,7 +20,7 @@
//! that expect babe-specific digests.
use super::ConsensusDataProvider;
use crate::Error;
use crate::{Error, LOG_TARGET};
use codec::Encode;
use sc_client_api::{AuxStore, UsageProvider};
use sc_consensus_babe::{
@@ -179,7 +179,7 @@ where
let epoch = epoch_changes
.viable_epoch(&epoch_descriptor, |slot| Epoch::genesis(&self.config, slot))
.ok_or_else(|| {
log::info!(target: "babe", "create_digest: no viable_epoch :(");
log::info!(target: LOG_TARGET, "create_digest: no viable_epoch :(");
sp_consensus::Error::InvalidAuthoritiesSet
})?;
@@ -290,7 +290,7 @@ where
let has_authority = epoch.authorities.iter().any(|(id, _)| *id == *authority);
if !has_authority {
log::info!(target: "manual-seal", "authority not found");
log::info!(target: LOG_TARGET, "authority not found");
let timestamp = inherents
.timestamp_inherent_data()?
.ok_or_else(|| Error::StringError("No timestamp inherent data".into()))?;
@@ -49,6 +49,8 @@ pub use self::{
use sc_transaction_pool_api::TransactionPool;
use sp_api::{ProvideRuntimeApi, TransactionFor};
const LOG_TARGET: &str = "manual-seal";
/// The `ConsensusEngineId` of Manual Seal.
pub const MANUAL_SEAL_ENGINE_ID: ConsensusEngineId = [b'm', b'a', b'n', b'l'];