Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[minor]staking: add logging target, followup to #1127 #1132

Open
wants to merge 2 commits into
base: manta
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion pallets/parachain-staking/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ pub use traits::*;
pub use types::*;
pub use RoundIndex;

#[cfg(not(feature = "on-chain-release-build"))]
const LOG_TARGET: &str = "parachain-staking";

#[pallet]
pub mod pallet {
use crate::{
Expand Down Expand Up @@ -1711,7 +1714,10 @@ pub mod pallet {
// choose the top TotalSelected qualified candidates, ordered by stake
let collators = Self::compute_top_candidates();
if collators.is_empty() {
log::error!("FAILED TO SELECT >=1 COLLATOR => using collators from previous round");
log::error!(
target: crate::LOG_TARGET,
"FAILED TO SELECT >=1 COLLATOR => using collators from previous round"
);
let last_round = now.saturating_sub(1u32);
let mut total_per_candidate: BTreeMap<T::AccountId, BalanceOf<T>> = BTreeMap::new();
// set this round AtStake to last round AtStake
Expand Down