Skip to content

Commit

Permalink
change tracing:error format
Browse files Browse the repository at this point in the history
  • Loading branch information
Ayevbeosa Iyamu committed Oct 7, 2024
1 parent 9b9f309 commit 58f374b
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions polkadot/xcm/xcm-executor/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ impl<Config: config::Config> XcmExecutor<Config> {
.holding
.try_take(asset_to_pay_for_fees.clone().into())
.map_err(|e| {
tracing::error!(target: "xcm::fees", "Failed to take asset_to_pay_for_fees: {asset_to_pay_for_fees:?} (based on fee: {fee:?}) from holding with error: {e:?}");
tracing::error!(target: "xcm::fees", ?e, ?asset_to_pay_for_fees, ?fee, "Failed to take asset_to_pay_for_fees from holding");
XcmError::NotHoldingFees
})?;
tracing::trace!(target: "xcm::fees", ?assets_taken_from_holding_to_pay_delivery_fees);
Expand All @@ -528,7 +528,7 @@ impl<Config: config::Config> XcmExecutor<Config> {
.map_err(|given_assets| {
tracing::error!(
target: "xcm::fees",
"Swap was deemed necessary but couldn't be done: {given_assets:?} for withdrawn_fee_asset: {withdrawn_fee_asset:?} and asset_needed_for_fees: {asset_needed_for_fees:?}",
?given_assets, ?withdrawn_fee_asset, ?asset_needed_for_fees, "Swap was deemed necessary but couldn't be done for withdrawn_fee_asset and asset_needed_for_fees",
);
XcmError::FeesNotMet
})?
Expand Down Expand Up @@ -590,7 +590,7 @@ impl<Config: config::Config> XcmExecutor<Config> {
None => None,
Some(q) => Some(
q.reanchored(&destination, &Config::UniversalLocation::get()).map_err(|e| {
tracing::error!(target: "xcm::xcm_executor::to_querier", "Failed to re-anchor local_querier: {e:?} for destination: {destination:?} and context: {:?}", Config::UniversalLocation::get());
tracing::error!(target: "xcm::xcm_executor::to_querier", ?e, ?destination, ?Config::UniversalLocation::get(), "Failed to re-anchor local_querier");
XcmError::ReanchorFailed
})?,
),
Expand Down Expand Up @@ -928,7 +928,7 @@ impl<Config: config::Config> XcmExecutor<Config> {
.ok_or(XcmError::BadOrigin)?
.append_with(who)
.map_err(|e| {
tracing::error!(target: "xcm::process_instruction::descend_origin", "Failed to append junctions: {e:?} with who: {who:?}");
tracing::error!(target: "xcm::process_instruction::descend_origin", ?e, ?who, "Failed to append junctions");
XcmError::LocationFull
}),
ClearOrigin => {
Expand Down Expand Up @@ -1095,7 +1095,7 @@ impl<Config: config::Config> XcmExecutor<Config> {
// pay for `weight` using up to `fees` of the holding register.
let max_fee =
self.holding.try_take(fees.clone().into()).map_err(|e| {
tracing::error!(target: "xcm::process_instruction::buy_execution", "Failed to take fees {fees:?} from holding with error: {e:?}");
tracing::error!(target: "xcm::process_instruction::buy_execution", ?e, ?fees "Failed to take fees from holding");
XcmError::NotHoldingFees
})?;
let result = || -> Result<(), XcmError> {
Expand Down Expand Up @@ -1161,7 +1161,7 @@ impl<Config: config::Config> XcmExecutor<Config> {
},
ExpectAsset(assets) =>
self.holding.ensure_contains(&assets).map_err(|e| {
tracing::error!(target: "xcm::process_instruction::expect_asset", "Failed ensure_contains for assets: {assets:?} with error: {e:?}");
tracing::error!(target: "xcm::process_instruction::expect_asset", ?e, ?assets "assets not contained in holding");
XcmError::ExpectationFalse
}),
ExpectOrigin(origin) => {
Expand Down Expand Up @@ -1286,7 +1286,7 @@ impl<Config: config::Config> XcmExecutor<Config> {
let lock_ticket =
Config::AssetLocker::prepare_lock(unlocker.clone(), asset, origin.clone())?;
let owner = origin.reanchored(&unlocker, &context).map_err(|e| {
tracing::error!(target: "xcm::xcm_executor::process_instruction", "Failed to re-anchor origin: {origin:?} for unlocker: {unlocker:?} and context: {context:?}");
tracing::error!(target: "xcm::xcm_executor::process_instruction", ?e, ?origin, ?unlocker, ?context, "Failed to re-anchor origin");
XcmError::ReanchorFailed
})?;
let msg = Xcm::<()>(vec![NoteUnlockable { asset: remote_asset, owner }]);
Expand Down

0 comments on commit 58f374b

Please sign in to comment.