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
@@ -17,9 +17,9 @@
// along with this program. If not, see <https://www.gnu.org/licenses/>.
//! Verification for BABE headers.
use super::{
use crate::{
authorship::{calculate_primary_threshold, check_primary_threshold, secondary_slot_author},
babe_err, find_pre_digest, BlockT, Epoch, Error,
babe_err, find_pre_digest, BlockT, Epoch, Error, LOG_TARGET,
};
use log::{debug, trace};
use sc_consensus_slots::CheckedHeader;
@@ -67,7 +67,7 @@ pub(super) fn check_header<B: BlockT + Sized>(
let authorities = &epoch.authorities;
let pre_digest = pre_digest.map(Ok).unwrap_or_else(|| find_pre_digest::<B>(&header))?;
trace!(target: "babe", "Checking header");
trace!(target: LOG_TARGET, "Checking header");
let seal = header
.digest_mut()
.pop()
@@ -93,7 +93,8 @@ pub(super) fn check_header<B: BlockT + Sized>(
match &pre_digest {
PreDigest::Primary(primary) => {
debug!(target: "babe",
debug!(
target: LOG_TARGET,
"Verifying primary block #{} at slot: {}",
header.number(),
primary.slot,
@@ -104,7 +105,8 @@ pub(super) fn check_header<B: BlockT + Sized>(
PreDigest::SecondaryPlain(secondary)
if epoch.config.allowed_slots.is_secondary_plain_slots_allowed() =>
{
debug!(target: "babe",
debug!(
target: LOG_TARGET,
"Verifying secondary plain block #{} at slot: {}",
header.number(),
secondary.slot,
@@ -115,7 +117,8 @@ pub(super) fn check_header<B: BlockT + Sized>(
PreDigest::SecondaryVRF(secondary)
if epoch.config.allowed_slots.is_secondary_vrf_slots_allowed() =>
{
debug!(target: "babe",
debug!(
target: LOG_TARGET,
"Verifying secondary VRF block #{} at slot: {}",
header.number(),
secondary.slot,