diff --git a/Cargo.lock b/Cargo.lock index a945d148e051..96db77fdce12 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -28012,7 +28012,6 @@ dependencies = [ "frame-support 28.0.0", "frame-system 28.0.0", "impl-trait-for-tuples", - "log", "pallet-asset-conversion 10.0.0", "pallet-assets 29.1.0", "pallet-balances 28.0.0", @@ -28033,6 +28032,7 @@ dependencies = [ "sp-weights 27.0.0", "staging-xcm 7.0.0", "staging-xcm-executor 7.0.0", + "tracing", ] [[package]] diff --git a/polkadot/xcm/xcm-builder/Cargo.toml b/polkadot/xcm/xcm-builder/Cargo.toml index eaa115740f3e..2dafba81d409 100644 --- a/polkadot/xcm/xcm-builder/Cargo.toml +++ b/polkadot/xcm/xcm-builder/Cargo.toml @@ -23,7 +23,7 @@ frame-support = { workspace = true } frame-system = { workspace = true } pallet-transaction-payment = { workspace = true } pallet-asset-conversion = { workspace = true } -log = { workspace = true } +tracing = { workspace = true } # Polkadot dependencies polkadot-parachain-primitives = { workspace = true } @@ -62,7 +62,7 @@ std = [ "codec/std", "frame-support/std", "frame-system/std", - "log/std", + "tracing/std", "pallet-asset-conversion/std", "pallet-transaction-payment/std", "polkadot-parachain-primitives/std", diff --git a/polkadot/xcm/xcm-builder/src/asset_exchange/single_asset_adapter/adapter.rs b/polkadot/xcm/xcm-builder/src/asset_exchange/single_asset_adapter/adapter.rs index 3108068686f9..a79b2e1f693a 100644 --- a/polkadot/xcm/xcm-builder/src/asset_exchange/single_asset_adapter/adapter.rs +++ b/polkadot/xcm/xcm-builder/src/asset_exchange/single_asset_adapter/adapter.rs @@ -61,7 +61,7 @@ where ) -> Result { let mut give_iter = give.fungible_assets_iter(); let give_asset = give_iter.next().ok_or_else(|| { - log::trace!( + tracing::trace!( target: "xcm::SingleAssetExchangeAdapter::exchange_asset", "No fungible asset was in `give`.", ); @@ -73,7 +73,7 @@ where let want_asset = want.get(0).ok_or_else(|| give.clone())?; let (give_asset_id, give_amount) = Matcher::matches_fungibles(&give_asset).map_err(|error| { - log::trace!( + tracing::trace!( target: "xcm::SingleAssetExchangeAdapter::exchange_asset", "Could not map XCM asset give {:?} to FRAME asset. Error: {:?}", give_asset, @@ -83,7 +83,7 @@ where })?; let (want_asset_id, want_amount) = Matcher::matches_fungibles(&want_asset).map_err(|error| { - log::trace!( + tracing::trace!( target: "xcm::SingleAssetExchangeAdapter::exchange_asset", "Could not map XCM asset want {:?} to FRAME asset. Error: {:?}", want_asset, @@ -106,7 +106,7 @@ where Some(want_amount), ) .map_err(|(credit_in, error)| { - log::error!( + tracing::error!( target: "xcm::SingleAssetExchangeAdapter::exchange_asset", "Could not perform the swap, error: {:?}.", error @@ -127,7 +127,7 @@ where want_amount, ) .map_err(|(credit_in, error)| { - log::error!( + tracing::error!( target: "xcm::SingleAssetExchangeAdapter::exchange_asset", "Could not perform the swap, error: {:?}.", error @@ -162,7 +162,7 @@ where // We first match both XCM assets to the asset ID types `AssetConversion` can handle. let (give_asset_id, give_amount) = Matcher::matches_fungibles(give_asset) .map_err(|error| { - log::trace!( + tracing::trace!( target: "xcm::SingleAssetExchangeAdapter::quote_exchange_price", "Could not map XCM asset {:?} to FRAME asset. Error: {:?}.", give_asset, @@ -173,7 +173,7 @@ where .ok()?; let (want_asset_id, want_amount) = Matcher::matches_fungibles(want_asset) .map_err(|error| { - log::trace!( + tracing::trace!( target: "xcm::SingleAssetExchangeAdapter::quote_exchange_price", "Could not map XCM asset {:?} to FRAME asset. Error: {:?}.", want_asset, diff --git a/polkadot/xcm/xcm-builder/src/barriers.rs b/polkadot/xcm/xcm-builder/src/barriers.rs index 56a8493ef0ab..1c7f7ec18f87 100644 --- a/polkadot/xcm/xcm-builder/src/barriers.rs +++ b/polkadot/xcm/xcm-builder/src/barriers.rs @@ -39,7 +39,7 @@ impl ShouldExecute for TakeWeightCredit { max_weight: Weight, properties: &mut Properties, ) -> Result<(), ProcessMessageError> { - log::trace!( + tracing::trace!( target: "xcm::barriers", "TakeWeightCredit origin: {:?}, instructions: {:?}, max_weight: {:?}, properties: {:?}", _origin, _instructions, max_weight, properties, @@ -68,7 +68,7 @@ impl> ShouldExecute for AllowTopLevelPaidExecutionFrom max_weight: Weight, _properties: &mut Properties, ) -> Result<(), ProcessMessageError> { - log::trace!( + tracing::trace!( target: "xcm::barriers", "AllowTopLevelPaidExecutionFrom origin: {:?}, instructions: {:?}, max_weight: {:?}, properties: {:?}", origin, instructions, max_weight, _properties, @@ -172,7 +172,7 @@ impl, MaxPref max_weight: Weight, properties: &mut Properties, ) -> Result<(), ProcessMessageError> { - log::trace!( + tracing::trace!( target: "xcm::barriers", "WithComputedOrigin origin: {:?}, instructions: {:?}, max_weight: {:?}, properties: {:?}", origin, instructions, max_weight, properties, @@ -229,7 +229,7 @@ impl ShouldExecute for TrailingSetTopicAsId Result<(), ProcessMessageError> { - log::trace!( + tracing::trace!( target: "xcm::barriers", "TrailingSetTopicAsId origin: {:?}, instructions: {:?}, max_weight: {:?}, properties: {:?}", origin, instructions, max_weight, properties, @@ -278,7 +278,7 @@ impl> ShouldExecute for AllowUnpaidExecutionFrom { _max_weight: Weight, _properties: &mut Properties, ) -> Result<(), ProcessMessageError> { - log::trace!( + tracing::trace!( target: "xcm::barriers", "AllowUnpaidExecutionFrom origin: {:?}, instructions: {:?}, max_weight: {:?}, properties: {:?}", origin, instructions, _max_weight, _properties, @@ -300,7 +300,7 @@ impl> ShouldExecute for AllowExplicitUnpaidExecutionFrom Result<(), ProcessMessageError> { - log::trace!( + tracing::trace!( target: "xcm::barriers", "AllowExplicitUnpaidExecutionFrom origin: {:?}, instructions: {:?}, max_weight: {:?}, properties: {:?}", origin, instructions, max_weight, _properties, @@ -359,7 +359,7 @@ impl ShouldExecute for AllowKnownQueryResponses Result<(), ProcessMessageError> { - log::trace!( + tracing::trace!( target: "xcm::barriers", "AllowKnownQueryResponses origin: {:?}, instructions: {:?}, max_weight: {:?}, properties: {:?}", origin, instructions, _max_weight, _properties, @@ -387,7 +387,7 @@ impl> ShouldExecute for AllowSubscriptionsFrom { _max_weight: Weight, _properties: &mut Properties, ) -> Result<(), ProcessMessageError> { - log::trace!( + tracing::trace!( target: "xcm::barriers", "AllowSubscriptionsFrom origin: {:?}, instructions: {:?}, max_weight: {:?}, properties: {:?}", origin, instructions, _max_weight, _properties, @@ -418,7 +418,7 @@ impl ShouldExecute for AllowHrmpNotificationsFromRelayChain { _max_weight: Weight, _properties: &mut Properties, ) -> Result<(), ProcessMessageError> { - log::trace!( + tracing::trace!( target: "xcm::barriers", "AllowHrmpNotificationsFromRelayChain origin: {:?}, instructions: {:?}, max_weight: {:?}, properties: {:?}", origin, instructions, _max_weight, _properties, @@ -488,7 +488,7 @@ impl ShouldExecute for DenyReserveTransferToRelayChain { ReserveAssetDeposited { .. } if matches!(origin, Location { parents: 1, interior: Here }) => { - log::warn!( + tracing::warn!( target: "xcm::barrier", "Unexpected ReserveAssetDeposited from the Relay Chain", ); diff --git a/polkadot/xcm/xcm-builder/src/currency_adapter.rs b/polkadot/xcm/xcm-builder/src/currency_adapter.rs index 355d6ad85388..790265a0a332 100644 --- a/polkadot/xcm/xcm-builder/src/currency_adapter.rs +++ b/polkadot/xcm/xcm-builder/src/currency_adapter.rs @@ -143,7 +143,7 @@ impl< for CurrencyAdapter { fn can_check_in(_origin: &Location, what: &Asset, _context: &XcmContext) -> Result { - log::trace!(target: "xcm::currency_adapter", "can_check_in origin: {:?}, what: {:?}", _origin, what); + tracing::trace!(target: "xcm::currency_adapter", "can_check_in origin: {:?}, what: {:?}", _origin, what); // Check we handle this asset. let amount: Currency::Balance = Matcher::matches_fungible(what).ok_or(Error::AssetNotHandled)?; @@ -157,7 +157,7 @@ impl< } fn check_in(_origin: &Location, what: &Asset, _context: &XcmContext) { - log::trace!(target: "xcm::currency_adapter", "check_in origin: {:?}, what: {:?}", _origin, what); + tracing::trace!(target: "xcm::currency_adapter", "check_in origin: {:?}, what: {:?}", _origin, what); if let Some(amount) = Matcher::matches_fungible(what) { match CheckedAccount::get() { Some((checked_account, MintLocation::Local)) => @@ -170,7 +170,7 @@ impl< } fn can_check_out(_dest: &Location, what: &Asset, _context: &XcmContext) -> Result { - log::trace!(target: "xcm::currency_adapter", "can_check_out dest: {:?}, what: {:?}", _dest, what); + tracing::trace!(target: "xcm::currency_adapter", "can_check_out dest: {:?}, what: {:?}", _dest, what); let amount = Matcher::matches_fungible(what).ok_or(Error::AssetNotHandled)?; match CheckedAccount::get() { Some((checked_account, MintLocation::Local)) => @@ -182,7 +182,7 @@ impl< } fn check_out(_dest: &Location, what: &Asset, _context: &XcmContext) { - log::trace!(target: "xcm::currency_adapter", "check_out dest: {:?}, what: {:?}", _dest, what); + tracing::trace!(target: "xcm::currency_adapter", "check_out dest: {:?}, what: {:?}", _dest, what); if let Some(amount) = Matcher::matches_fungible(what) { match CheckedAccount::get() { Some((checked_account, MintLocation::Local)) => @@ -195,7 +195,7 @@ impl< } fn deposit_asset(what: &Asset, who: &Location, _context: Option<&XcmContext>) -> Result { - log::trace!(target: "xcm::currency_adapter", "deposit_asset what: {:?}, who: {:?}", what, who); + tracing::trace!(target: "xcm::currency_adapter", "deposit_asset what: {:?}, who: {:?}", what, who); // Check we handle this asset. let amount = Matcher::matches_fungible(&what).ok_or(Error::AssetNotHandled)?; let who = @@ -209,7 +209,7 @@ impl< who: &Location, _maybe_context: Option<&XcmContext>, ) -> result::Result { - log::trace!(target: "xcm::currency_adapter", "withdraw_asset what: {:?}, who: {:?}", what, who); + tracing::trace!(target: "xcm::currency_adapter", "withdraw_asset what: {:?}, who: {:?}", what, who); // Check we handle this asset. let amount = Matcher::matches_fungible(what).ok_or(Error::AssetNotHandled)?; let who = @@ -225,7 +225,7 @@ impl< to: &Location, _context: &XcmContext, ) -> result::Result { - log::trace!(target: "xcm::currency_adapter", "internal_transfer_asset asset: {:?}, from: {:?}, to: {:?}", asset, from, to); + tracing::trace!(target: "xcm::currency_adapter", "internal_transfer_asset asset: {:?}, from: {:?}, to: {:?}", asset, from, to); let amount = Matcher::matches_fungible(asset).ok_or(Error::AssetNotHandled)?; let from = AccountIdConverter::convert_location(from).ok_or(Error::AccountIdConversionFailed)?; diff --git a/polkadot/xcm/xcm-builder/src/fee_handling.rs b/polkadot/xcm/xcm-builder/src/fee_handling.rs index 17e9e64e00c9..352118d762ab 100644 --- a/polkadot/xcm/xcm-builder/src/fee_handling.rs +++ b/polkadot/xcm/xcm-builder/src/fee_handling.rs @@ -127,7 +127,7 @@ pub fn deposit_or_burn_fee( ) { for asset in fee.into_inner() { if let Err(e) = AssetTransactor::deposit_asset(&asset, &dest, context) { - log::trace!( + tracing::trace!( target: "xcm::fees", "`AssetTransactor::deposit_asset` returned error: {e:?}. Burning fee: {asset:?}. \ They might be burned.", diff --git a/polkadot/xcm/xcm-builder/src/filter_asset_location.rs b/polkadot/xcm/xcm-builder/src/filter_asset_location.rs index 16b7be7f3ba9..c967c9e0eb0b 100644 --- a/polkadot/xcm/xcm-builder/src/filter_asset_location.rs +++ b/polkadot/xcm/xcm-builder/src/filter_asset_location.rs @@ -26,7 +26,7 @@ use xcm::latest::{Asset, AssetFilter, AssetId, Location, WildAsset}; pub struct NativeAsset; impl ContainsPair for NativeAsset { fn contains(asset: &Asset, origin: &Location) -> bool { - log::trace!(target: "xcm::contains", "NativeAsset asset: {:?}, origin: {:?}", asset, origin); + tracing::trace!(target: "xcm::contains", "NativeAsset asset: {:?}, origin: {:?}", asset, origin); matches!(asset.id, AssetId(ref id) if id == origin) } } @@ -35,7 +35,7 @@ impl ContainsPair for NativeAsset { pub struct Case(PhantomData); impl> ContainsPair for Case { fn contains(asset: &Asset, origin: &Location) -> bool { - log::trace!(target: "xcm::contains", "Case asset: {:?}, origin: {:?}", asset, origin); + tracing::trace!(target: "xcm::contains", "Case asset: {:?}, origin: {:?}", asset, origin); let (a, o) = T::get(); a.matches(asset) && &o == origin } @@ -51,7 +51,7 @@ impl, AssetFilters: Get>> Contains<(Location, Vec)> for LocationWithAssetFilters { fn contains((location, assets): &(Location, Vec)) -> bool { - log::trace!(target: "xcm::contains", "LocationWithAssetFilters location: {:?}, assets: {:?}", location, assets); + tracing::trace!(target: "xcm::contains", "LocationWithAssetFilters location: {:?}, assets: {:?}", location, assets); // `location` must match the `Location` filter. if !LocationFilter::contains(location) { diff --git a/polkadot/xcm/xcm-builder/src/fungible_adapter.rs b/polkadot/xcm/xcm-builder/src/fungible_adapter.rs index 25a705a39eb7..7a70beebd264 100644 --- a/polkadot/xcm/xcm-builder/src/fungible_adapter.rs +++ b/polkadot/xcm/xcm-builder/src/fungible_adapter.rs @@ -53,7 +53,7 @@ impl< to: &Location, _context: &XcmContext, ) -> result::Result { - log::trace!( + tracing::trace!( target: "xcm::fungible_adapter", "internal_transfer_asset what: {:?}, from: {:?}, to: {:?}", what, from, to @@ -119,7 +119,7 @@ impl< for FungibleMutateAdapter { fn can_check_in(_origin: &Location, what: &Asset, _context: &XcmContext) -> XcmResult { - log::trace!( + tracing::trace!( target: "xcm::fungible_adapter", "can_check_in origin: {:?}, what: {:?}", _origin, what @@ -136,7 +136,7 @@ impl< } fn check_in(_origin: &Location, what: &Asset, _context: &XcmContext) { - log::trace!( + tracing::trace!( target: "xcm::fungible_adapter", "check_in origin: {:?}, what: {:?}", _origin, what @@ -153,7 +153,7 @@ impl< } fn can_check_out(_dest: &Location, what: &Asset, _context: &XcmContext) -> XcmResult { - log::trace!( + tracing::trace!( target: "xcm::fungible_adapter", "can_check_out dest: {:?}, what: {:?}", _dest, @@ -170,7 +170,7 @@ impl< } fn check_out(_dest: &Location, what: &Asset, _context: &XcmContext) { - log::trace!( + tracing::trace!( target: "xcm::fungible_adapter", "check_out dest: {:?}, what: {:?}", _dest, @@ -188,7 +188,7 @@ impl< } fn deposit_asset(what: &Asset, who: &Location, _context: Option<&XcmContext>) -> XcmResult { - log::trace!( + tracing::trace!( target: "xcm::fungible_adapter", "deposit_asset what: {:?}, who: {:?}", what, who, @@ -206,7 +206,7 @@ impl< who: &Location, _context: Option<&XcmContext>, ) -> result::Result { - log::trace!( + tracing::trace!( target: "xcm::fungible_adapter", "withdraw_asset what: {:?}, who: {:?}", what, who, diff --git a/polkadot/xcm/xcm-builder/src/fungibles_adapter.rs b/polkadot/xcm/xcm-builder/src/fungibles_adapter.rs index a259afc6e682..93eef3edb940 100644 --- a/polkadot/xcm/xcm-builder/src/fungibles_adapter.rs +++ b/polkadot/xcm/xcm-builder/src/fungibles_adapter.rs @@ -47,7 +47,7 @@ impl< to: &Location, _context: &XcmContext, ) -> result::Result { - log::trace!( + tracing::trace!( target: "xcm::fungibles_adapter", "internal_transfer_asset what: {:?}, from: {:?}, to: {:?}", what, from, to @@ -204,7 +204,7 @@ impl< > { fn can_check_in(_origin: &Location, what: &Asset, _context: &XcmContext) -> XcmResult { - log::trace!( + tracing::trace!( target: "xcm::fungibles_adapter", "can_check_in origin: {:?}, what: {:?}", _origin, what @@ -221,7 +221,7 @@ impl< } fn check_in(_origin: &Location, what: &Asset, _context: &XcmContext) { - log::trace!( + tracing::trace!( target: "xcm::fungibles_adapter", "check_in origin: {:?}, what: {:?}", _origin, what @@ -238,7 +238,7 @@ impl< } fn can_check_out(_origin: &Location, what: &Asset, _context: &XcmContext) -> XcmResult { - log::trace!( + tracing::trace!( target: "xcm::fungibles_adapter", "can_check_out origin: {:?}, what: {:?}", _origin, what @@ -255,7 +255,7 @@ impl< } fn check_out(_dest: &Location, what: &Asset, _context: &XcmContext) { - log::trace!( + tracing::trace!( target: "xcm::fungibles_adapter", "check_out dest: {:?}, what: {:?}", _dest, what @@ -272,7 +272,7 @@ impl< } fn deposit_asset(what: &Asset, who: &Location, _context: Option<&XcmContext>) -> XcmResult { - log::trace!( + tracing::trace!( target: "xcm::fungibles_adapter", "deposit_asset what: {:?}, who: {:?}", what, who, @@ -291,7 +291,7 @@ impl< who: &Location, _maybe_context: Option<&XcmContext>, ) -> result::Result { - log::trace!( + tracing::trace!( target: "xcm::fungibles_adapter", "withdraw_asset what: {:?}, who: {:?}", what, who, diff --git a/polkadot/xcm/xcm-builder/src/location_conversion.rs b/polkadot/xcm/xcm-builder/src/location_conversion.rs index 1d840e9c0dde..93b29f32fe3e 100644 --- a/polkadot/xcm/xcm-builder/src/location_conversion.rs +++ b/polkadot/xcm/xcm-builder/src/location_conversion.rs @@ -392,7 +392,7 @@ impl, AccountId: From<[u8; 32]> + Clone { fn convert_location(location: &Location) -> Option { let universal_source = UniversalLocation::get(); - log::trace!( + tracing::trace!( target: "xcm::location_conversion", "GlobalConsensusConvertsFor universal_source: {:?}, location: {:?}", universal_source, location, @@ -435,7 +435,7 @@ impl, AccountId: From<[u8; 32]> + Clone { fn convert_location(location: &Location) -> Option { let universal_source = UniversalLocation::get(); - log::trace!( + tracing::trace!( target: "xcm::location_conversion", "GlobalConsensusParachainConvertsFor universal_source: {:?}, location: {:?}", universal_source, location, diff --git a/polkadot/xcm/xcm-builder/src/nonfungible_adapter.rs b/polkadot/xcm/xcm-builder/src/nonfungible_adapter.rs index 8e6232ea64d2..308980cdb3e6 100644 --- a/polkadot/xcm/xcm-builder/src/nonfungible_adapter.rs +++ b/polkadot/xcm/xcm-builder/src/nonfungible_adapter.rs @@ -49,7 +49,7 @@ impl< to: &Location, context: &XcmContext, ) -> result::Result { - log::trace!( + tracing::trace!( target: LOG_TARGET, "transfer_asset what: {:?}, from: {:?}, to: {:?}, context: {:?}", what, @@ -117,7 +117,7 @@ impl< for NonFungibleMutateAdapter { fn can_check_in(_origin: &Location, what: &Asset, context: &XcmContext) -> XcmResult { - log::trace!( + tracing::trace!( target: LOG_TARGET, "can_check_in origin: {:?}, what: {:?}, context: {:?}", _origin, @@ -137,7 +137,7 @@ impl< } fn check_in(_origin: &Location, what: &Asset, context: &XcmContext) { - log::trace!( + tracing::trace!( target: LOG_TARGET, "check_in origin: {:?}, what: {:?}, context: {:?}", _origin, @@ -157,7 +157,7 @@ impl< } fn can_check_out(_dest: &Location, what: &Asset, context: &XcmContext) -> XcmResult { - log::trace!( + tracing::trace!( target: LOG_TARGET, "can_check_out dest: {:?}, what: {:?}, context: {:?}", _dest, @@ -177,7 +177,7 @@ impl< } fn check_out(_dest: &Location, what: &Asset, context: &XcmContext) { - log::trace!( + tracing::trace!( target: LOG_TARGET, "check_out dest: {:?}, what: {:?}, context: {:?}", _dest, @@ -197,7 +197,7 @@ impl< } fn deposit_asset(what: &Asset, who: &Location, context: Option<&XcmContext>) -> XcmResult { - log::trace!( + tracing::trace!( target: LOG_TARGET, "deposit_asset what: {:?}, who: {:?}, context: {:?}", what, @@ -217,7 +217,7 @@ impl< who: &Location, maybe_context: Option<&XcmContext>, ) -> result::Result { - log::trace!( + tracing::trace!( target: LOG_TARGET, "withdraw_asset what: {:?}, who: {:?}, maybe_context: {:?}", what, diff --git a/polkadot/xcm/xcm-builder/src/nonfungibles_adapter.rs b/polkadot/xcm/xcm-builder/src/nonfungibles_adapter.rs index 006c28954bce..2aa867448424 100644 --- a/polkadot/xcm/xcm-builder/src/nonfungibles_adapter.rs +++ b/polkadot/xcm/xcm-builder/src/nonfungibles_adapter.rs @@ -48,7 +48,7 @@ impl< to: &Location, context: &XcmContext, ) -> result::Result { - log::trace!( + tracing::trace!( target: LOG_TARGET, "transfer_asset what: {:?}, from: {:?}, to: {:?}, context: {:?}", what, @@ -138,7 +138,7 @@ impl< > { fn can_check_in(_origin: &Location, what: &Asset, context: &XcmContext) -> XcmResult { - log::trace!( + tracing::trace!( target: LOG_TARGET, "can_check_in origin: {:?}, what: {:?}, context: {:?}", _origin, @@ -157,7 +157,7 @@ impl< } fn check_in(_origin: &Location, what: &Asset, context: &XcmContext) { - log::trace!( + tracing::trace!( target: LOG_TARGET, "check_in origin: {:?}, what: {:?}, context: {:?}", _origin, @@ -176,7 +176,7 @@ impl< } fn can_check_out(_dest: &Location, what: &Asset, context: &XcmContext) -> XcmResult { - log::trace!( + tracing::trace!( target: LOG_TARGET, "can_check_out dest: {:?}, what: {:?}, context: {:?}", _dest, @@ -195,7 +195,7 @@ impl< } fn check_out(_dest: &Location, what: &Asset, context: &XcmContext) { - log::trace!( + tracing::trace!( target: LOG_TARGET, "check_out dest: {:?}, what: {:?}, context: {:?}", _dest, @@ -214,7 +214,7 @@ impl< } fn deposit_asset(what: &Asset, who: &Location, context: Option<&XcmContext>) -> XcmResult { - log::trace!( + tracing::trace!( target: LOG_TARGET, "deposit_asset what: {:?}, who: {:?}, context: {:?}", what, @@ -234,7 +234,7 @@ impl< who: &Location, maybe_context: Option<&XcmContext>, ) -> result::Result { - log::trace!( + tracing::trace!( target: LOG_TARGET, "withdraw_asset what: {:?}, who: {:?}, maybe_context: {:?}", what, diff --git a/polkadot/xcm/xcm-builder/src/origin_conversion.rs b/polkadot/xcm/xcm-builder/src/origin_conversion.rs index 6e73c0dae7b6..e396bc1170ac 100644 --- a/polkadot/xcm/xcm-builder/src/origin_conversion.rs +++ b/polkadot/xcm/xcm-builder/src/origin_conversion.rs @@ -39,7 +39,7 @@ where kind: OriginKind, ) -> Result { let origin = origin.into(); - log::trace!( + tracing::trace!( target: "xcm::origin_conversion", "SovereignSignedViaLocation origin: {:?}, kind: {:?}", origin, kind, @@ -60,7 +60,7 @@ impl ConvertOrigin for ParentAsSuperu kind: OriginKind, ) -> Result { let origin = origin.into(); - log::trace!(target: "xcm::origin_conversion", "ParentAsSuperuser origin: {:?}, kind: {:?}", origin, kind); + tracing::trace!(target: "xcm::origin_conversion", "ParentAsSuperuser origin: {:?}, kind: {:?}", origin, kind); if kind == OriginKind::Superuser && origin.contains_parents_only(1) { Ok(RuntimeOrigin::root()) } else { @@ -80,7 +80,7 @@ impl, RuntimeOrigin: OriginTrait> ConvertOrigin Result { let origin = origin.into(); - log::trace!(target: "xcm::origin_conversion", "ChildSystemParachainAsSuperuser origin: {:?}, kind: {:?}", origin, kind); + tracing::trace!(target: "xcm::origin_conversion", "ChildSystemParachainAsSuperuser origin: {:?}, kind: {:?}", origin, kind); match (kind, origin.unpack()) { (OriginKind::Superuser, (0, [Junction::Parachain(id)])) if ParaId::from(*id).is_system() => @@ -101,7 +101,7 @@ impl, RuntimeOrigin: OriginTrait> ConvertOrigin Result { let origin = origin.into(); - log::trace!( + tracing::trace!( target: "xcm::origin_conversion", "SiblingSystemParachainAsSuperuser origin: {:?}, kind: {:?}", origin, kind, @@ -126,7 +126,7 @@ impl, RuntimeOrigin: From> ConvertOr kind: OriginKind, ) -> Result { let origin = origin.into(); - log::trace!(target: "xcm::origin_conversion", "ChildParachainAsNative origin: {:?}, kind: {:?}", origin, kind); + tracing::trace!(target: "xcm::origin_conversion", "ChildParachainAsNative origin: {:?}, kind: {:?}", origin, kind); match (kind, origin.unpack()) { (OriginKind::Native, (0, [Junction::Parachain(id)])) => Ok(RuntimeOrigin::from(ParachainOrigin::from(*id))), @@ -146,7 +146,7 @@ impl, RuntimeOrigin: From> ConvertOr kind: OriginKind, ) -> Result { let origin = origin.into(); - log::trace!( + tracing::trace!( target: "xcm::origin_conversion", "SiblingParachainAsNative origin: {:?}, kind: {:?}", origin, kind, @@ -171,7 +171,7 @@ impl, RuntimeOrigin> ConvertOrigin Result { let origin = origin.into(); - log::trace!(target: "xcm::origin_conversion", "RelayChainAsNative origin: {:?}, kind: {:?}", origin, kind); + tracing::trace!(target: "xcm::origin_conversion", "RelayChainAsNative origin: {:?}, kind: {:?}", origin, kind); if kind == OriginKind::Native && origin.contains_parents_only(1) { Ok(RelayOrigin::get()) } else { @@ -191,7 +191,7 @@ where kind: OriginKind, ) -> Result { let origin = origin.into(); - log::trace!( + tracing::trace!( target: "xcm::origin_conversion", "SignedAccountId32AsNative origin: {:?}, kind: {:?}", origin, kind, @@ -218,7 +218,7 @@ where kind: OriginKind, ) -> Result { let origin = origin.into(); - log::trace!( + tracing::trace!( target: "xcm::origin_conversion", "SignedAccountKey20AsNative origin: {:?}, kind: {:?}", origin, kind, diff --git a/polkadot/xcm/xcm-builder/src/process_xcm_message.rs b/polkadot/xcm/xcm-builder/src/process_xcm_message.rs index 67c05c116e9d..a0e49b6e29e8 100644 --- a/polkadot/xcm/xcm-builder/src/process_xcm_message.rs +++ b/polkadot/xcm/xcm-builder/src/process_xcm_message.rs @@ -48,7 +48,7 @@ impl< id: &mut XcmHash, ) -> Result { let versioned_message = VersionedXcm::::decode(&mut &message[..]).map_err(|e| { - log::trace!( + tracing::trace!( target: LOG_TARGET, "`VersionedXcm` failed to decode: {e:?}", ); @@ -56,7 +56,7 @@ impl< ProcessMessageError::Corrupt })?; let message = Xcm::::try_from(versioned_message).map_err(|_| { - log::trace!( + tracing::trace!( target: LOG_TARGET, "Failed to convert `VersionedXcm` into `xcm::prelude::Xcm`!", ); @@ -64,7 +64,7 @@ impl< ProcessMessageError::Unsupported })?; let pre = XcmExecutor::prepare(message).map_err(|_| { - log::trace!( + tracing::trace!( target: LOG_TARGET, "Failed to prepare message.", ); @@ -74,7 +74,7 @@ impl< // The worst-case weight: let required = pre.weight_of(); if !meter.can_consume(required) { - log::trace!( + tracing::trace!( target: LOG_TARGET, "Xcm required {required} more than remaining {}", meter.remaining(), @@ -86,14 +86,14 @@ impl< let (consumed, result) = match XcmExecutor::execute(origin.into(), pre, id, Weight::zero()) { Outcome::Complete { used } => { - log::trace!( + tracing::trace!( target: LOG_TARGET, "XCM message execution complete, used weight: {used}", ); (used, Ok(true)) }, Outcome::Incomplete { used, error } => { - log::trace!( + tracing::trace!( target: LOG_TARGET, "XCM message execution incomplete, used weight: {used}, error: {error:?}", ); @@ -101,7 +101,7 @@ impl< }, // In the error-case we assume the worst case and consume all possible weight. Outcome::Error { error } => { - log::trace!( + tracing::trace!( target: LOG_TARGET, "XCM message execution error: {error:?}", ); diff --git a/polkadot/xcm/xcm-builder/src/routing.rs b/polkadot/xcm/xcm-builder/src/routing.rs index fc2de89d2128..5fb4289fe6c5 100644 --- a/polkadot/xcm/xcm-builder/src/routing.rs +++ b/polkadot/xcm/xcm-builder/src/routing.rs @@ -198,7 +198,7 @@ impl SendXcm for EnsureDecodableXcm { if let Some(msg) = message { let versioned_xcm = VersionedXcm::<()>::from(msg.clone()); if versioned_xcm.validate_xcm_nesting().is_err() { - log::error!( + tracing::error!( target: "xcm::validate_xcm_nesting", "EnsureDecodableXcm validate_xcm_nesting error for \nversioned_xcm: {versioned_xcm:?}\nbased on xcm: {msg:?}" ); diff --git a/polkadot/xcm/xcm-builder/src/weight.rs b/polkadot/xcm/xcm-builder/src/weight.rs index 6521121f2c94..5396c0bec19c 100644 --- a/polkadot/xcm/xcm-builder/src/weight.rs +++ b/polkadot/xcm/xcm-builder/src/weight.rs @@ -39,7 +39,7 @@ impl, C: Decode + GetDispatchInfo, M: Get> WeightBounds for FixedWeightBounds { fn weight(message: &mut Xcm) -> Result { - log::trace!(target: "xcm::weight", "FixedWeightBounds message: {:?}", message); + tracing::trace!(target: "xcm::weight", "FixedWeightBounds message: {:?}", message); let mut instructions_left = M::get(); Self::weight_with_limit(message, &mut instructions_left) } @@ -82,7 +82,7 @@ where Instruction: xcm::latest::GetWeight, { fn weight(message: &mut Xcm) -> Result { - log::trace!(target: "xcm::weight", "WeightInfoBounds message: {:?}", message); + tracing::trace!(target: "xcm::weight", "WeightInfoBounds message: {:?}", message); let mut instructions_left = M::get(); Self::weight_with_limit(message, &mut instructions_left) } @@ -154,7 +154,7 @@ impl, R: TakeRevenue> WeightTrader for FixedRateOf payment: AssetsInHolding, context: &XcmContext, ) -> Result { - log::trace!( + tracing::trace!( target: "xcm::weight", "FixedRateOfFungible::buy_weight weight: {:?}, payment: {:?}, context: {:?}", weight, payment, context, @@ -174,7 +174,7 @@ impl, R: TakeRevenue> WeightTrader for FixedRateOf } fn refund_weight(&mut self, weight: Weight, context: &XcmContext) -> Option { - log::trace!(target: "xcm::weight", "FixedRateOfFungible::refund_weight weight: {:?}, context: {:?}", weight, context); + tracing::trace!(target: "xcm::weight", "FixedRateOfFungible::refund_weight weight: {:?}, context: {:?}", weight, context); let (id, units_per_second, units_per_mb) = T::get(); let weight = weight.min(self.0); let amount = (units_per_second * (weight.ref_time() as u128) / @@ -229,7 +229,7 @@ impl< payment: AssetsInHolding, context: &XcmContext, ) -> Result { - log::trace!(target: "xcm::weight", "UsingComponents::buy_weight weight: {:?}, payment: {:?}, context: {:?}", weight, payment, context); + tracing::trace!(target: "xcm::weight", "UsingComponents::buy_weight weight: {:?}, payment: {:?}, context: {:?}", weight, payment, context); let amount = WeightToFee::weight_to_fee(&weight); let u128_amount: u128 = amount.try_into().map_err(|_| XcmError::Overflow)?; let required = Asset { id: AssetId(AssetIdValue::get()), fun: Fungible(u128_amount) }; @@ -240,13 +240,13 @@ impl< } fn refund_weight(&mut self, weight: Weight, context: &XcmContext) -> Option { - log::trace!(target: "xcm::weight", "UsingComponents::refund_weight weight: {:?}, context: {:?}, available weight: {:?}, available amount: {:?}", weight, context, self.0, self.1); + tracing::trace!(target: "xcm::weight", "UsingComponents::refund_weight weight: {:?}, context: {:?}, available weight: {:?}, available amount: {:?}", weight, context, self.0, self.1); let weight = weight.min(self.0); let amount = WeightToFee::weight_to_fee(&weight); self.0 -= weight; self.1 = self.1.saturating_sub(amount); let amount: u128 = amount.saturated_into(); - log::trace!(target: "xcm::weight", "UsingComponents::refund_weight amount to refund: {:?}", amount); + tracing::trace!(target: "xcm::weight", "UsingComponents::refund_weight amount to refund: {:?}", amount); if amount > 0 { Some((AssetIdValue::get(), amount).into()) } else {