mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-19 13:25:44 +00:00
introduce log-target constant to more frame pallets (#13116)
* introduce log-target constant to more frame pallets * cargo fmt * make LOG_TARGET in session public * Update frame/elections-phragmen/src/lib.rs Co-authored-by: Bastian Köcher <git@kchr.de> * Update frame/elections-phragmen/src/migrations/v3.rs Co-authored-by: Bastian Köcher <git@kchr.de> * Update frame/elections-phragmen/src/migrations/v3.rs Co-authored-by: Bastian Köcher <git@kchr.de> * Update frame/elections-phragmen/src/migrations/v3.rs Co-authored-by: Bastian Köcher <git@kchr.de> * move LOG_TARGET=runtime::session_historical to migrations module, where it's actually used Co-authored-by: Bastian Köcher <git@kchr.de>
This commit is contained in:
@@ -122,6 +122,8 @@ pub use weights::WeightInfo;
|
||||
/// All migrations.
|
||||
pub mod migrations;
|
||||
|
||||
const LOG_TARGET: &str = "runtime::elections-phragmen";
|
||||
|
||||
/// The maximum votes allowed per voter.
|
||||
pub const MAXIMUM_VOTE: usize = 16;
|
||||
|
||||
@@ -789,10 +791,7 @@ impl<T: Config> Pallet<T> {
|
||||
} else {
|
||||
// overlap. This can never happen. If so, it seems like our intended replacement
|
||||
// is already a member, so not much more to do.
|
||||
log::error!(
|
||||
target: "runtime::elections-phragmen",
|
||||
"A member seems to also be a runner-up.",
|
||||
);
|
||||
log::error!(target: LOG_TARGET, "A member seems to also be a runner-up.");
|
||||
}
|
||||
next_best
|
||||
});
|
||||
@@ -939,7 +938,7 @@ impl<T: Config> Pallet<T> {
|
||||
Ok(_) => (),
|
||||
Err(_) => {
|
||||
log::error!(
|
||||
target: "runtime::elections-phragmen",
|
||||
target: LOG_TARGET,
|
||||
"Failed to run election. Number of voters exceeded",
|
||||
);
|
||||
Self::deposit_event(Event::ElectionError);
|
||||
@@ -1103,11 +1102,7 @@ impl<T: Config> Pallet<T> {
|
||||
<ElectionRounds<T>>::mutate(|v| *v += 1);
|
||||
})
|
||||
.map_err(|e| {
|
||||
log::error!(
|
||||
target: "runtime::elections-phragmen",
|
||||
"Failed to run election [{:?}].",
|
||||
e,
|
||||
);
|
||||
log::error!(target: LOG_TARGET, "Failed to run election [{:?}].", e,);
|
||||
Self::deposit_event(Event::ElectionError);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user