diff --git a/Cargo.lock b/Cargo.lock index 03f99155..cc0b4f12 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1357,7 +1357,6 @@ dependencies = [ "frame-system-rpc-runtime-api", "frame-try-runtime", "hex", - "log", "pallet-authorship", "pallet-babe", "pallet-bridge-grandpa", @@ -1408,6 +1407,7 @@ dependencies = [ "staging-xcm-executor", "static_assertions", "substrate-wasm-builder", + "tracing", ] [[package]] @@ -7115,10 +7115,10 @@ dependencies = [ name = "pallet-relayer-set" version = "1.0.0" dependencies = [ - "log", "parity-scale-codec", "polkadot-sdk-frame", "scale-info", + "tracing", ] [[package]] @@ -7314,7 +7314,6 @@ dependencies = [ name = "pallet-validator-set" version = "1.0.0" dependencies = [ - "log", "pallet-session", "pallets-common", "parity-scale-codec", @@ -7322,6 +7321,7 @@ dependencies = [ "scale-info", "serde", "sp-staking", + "tracing", ] [[package]] @@ -7865,7 +7865,6 @@ dependencies = [ "frame-system-rpc-runtime-api", "frame-try-runtime", "hex", - "log", "pallet-authorship", "pallet-babe", "pallet-bridge-grandpa", @@ -7914,6 +7913,7 @@ dependencies = [ "staging-xcm-executor", "static_assertions", "substrate-wasm-builder", + "tracing", ] [[package]] diff --git a/pallets/relayer-set/Cargo.toml b/pallets/relayer-set/Cargo.toml index 1b2bb6f1..644cce1c 100644 --- a/pallets/relayer-set/Cargo.toml +++ b/pallets/relayer-set/Cargo.toml @@ -12,7 +12,7 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] codec = { workspace = true } -log = { workspace = true, default-features = true } +tracing = { workspace = true, default-features = true } scale-info = { features = ["derive"], workspace = true } polkadot-sdk-frame = { workspace = true, default-features = false, features = [ @@ -26,7 +26,7 @@ runtime-benchmarks = [ ] std = [ "codec/std", - "log/std", + "tracing/std", "polkadot-sdk-frame/std", "scale-info/std", ] diff --git a/pallets/relayer-set/src/lib.rs b/pallets/relayer-set/src/lib.rs index 150c3b31..e660c5b7 100644 --- a/pallets/relayer-set/src/lib.rs +++ b/pallets/relayer-set/src/lib.rs @@ -156,7 +156,7 @@ impl Pallet { // Decrement who's provider reference count if let Err(err) = frame_system::Pallet::::dec_providers(who) { - log::warn!( + tracing::warn!( target: LOG_TARGET, "Failed to decrement provider reference count for relayer {who:?}, \ leaking reference: {err:?}" @@ -185,7 +185,7 @@ impl Pallet { Some(relayer) => relayer.min_bridge_tx_block = frame_system::Pallet::::block_number() .saturating_add(T::BridgeTxFailCooldownBlocks::get()), - None => log::warn!( + None => tracing::warn!( target: LOG_TARGET, "Could not find signer {who:?} of failed bridge transaction in relayer set" ), diff --git a/pallets/validator-set/Cargo.toml b/pallets/validator-set/Cargo.toml index 3d6da76b..725ddb94 100644 --- a/pallets/validator-set/Cargo.toml +++ b/pallets/validator-set/Cargo.toml @@ -8,7 +8,7 @@ license = 'Apache-2.0' [dependencies] codec = { workspace = true, features = ["derive"] } -log = { workspace = true, default-features = true } +tracing = { workspace = true, default-features = true } scale-info = { features = ["derive"], workspace = true } polkadot-sdk-frame = { workspace = true, default-features = false, features = [ @@ -32,7 +32,7 @@ runtime-benchmarks = [ "sp-staking/runtime-benchmarks", ] std = [ - "log/std", + "tracing/std", "pallets-common/std", "sp-staking/std", 'codec/std', diff --git a/pallets/validator-set/src/lib.rs b/pallets/validator-set/src/lib.rs index e3e91c6f..47918c65 100644 --- a/pallets/validator-set/src/lib.rs +++ b/pallets/validator-set/src/lib.rs @@ -238,13 +238,13 @@ impl Pallet { if let Err(err) = pallet_session::Pallet::::purge_keys(RawOrigin::Signed(who.clone()).into()) { - log::trace!( + tracing::trace!( target: LOG_TARGET, "Failed to purge session keys for validator {who:?}: {err:?}" ); } if let Err(err) = frame_system::Pallet::::dec_providers(who) { - log::warn!( + tracing::warn!( target: LOG_TARGET, "Failed to decrement provider reference count for validator {who:?}, \ leaking reference: {err:?}" diff --git a/runtime/Cargo.toml b/runtime/Cargo.toml index 1e8da75f..1e61fc00 100644 --- a/runtime/Cargo.toml +++ b/runtime/Cargo.toml @@ -13,7 +13,7 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] codec = { workspace = true, features = ["derive"] } -log = { workspace = true } +tracing = { workspace = true } scale-info = { features = ["derive"], workspace = true } serde_json = { features = ["alloc"], workspace = true } frame-executive = { workspace = true } @@ -104,7 +104,7 @@ static_assertions = { workspace = true } default = ["std"] std = [ "codec/std", - "log/std", + "tracing/std", "scale-info/std", "serde_json/std", diff --git a/runtime/src/bridge_config.rs b/runtime/src/bridge_config.rs index a419fad1..e270b633 100644 --- a/runtime/src/bridge_config.rs +++ b/runtime/src/bridge_config.rs @@ -153,7 +153,7 @@ impl payload, Err(e) => { - log::error!( + tracing::error!( target: LOG_TARGET_BRIDGE_DISPATCH, "dispatch - payload error: {e:?} for lane_id: {:?} and message_nonce: {:?}", message.key.lane_id, @@ -167,7 +167,7 @@ impl { - log::debug!( + tracing::debug!( target: LOG_TARGET_BRIDGE_DISPATCH, "dispatch - `DispatchBlob::dispatch_blob` was ok for lane_id: {:?} and message_nonce: {:?}", message.key.lane_id, @@ -176,7 +176,7 @@ impl { - log::error!( + tracing::error!( target: LOG_TARGET_BRIDGE_DISPATCH, "dispatch - `DispatchBlob::dispatch_blob` failed with error: {e:?} for lane_id: {:?} and message_nonce: {:?}", message.key.lane_id, @@ -279,7 +279,7 @@ where XCM_LANE, &blob, ) .map_err(|e| { - log::error!( + tracing::error!( target: LOG_TARGET_BRIDGE_DISPATCH, "haul_blob result - error: {e:?} on lane: {XCM_LANE:?}", ); @@ -288,7 +288,7 @@ where let artifacts = pallet_bridge_messages::Pallet::::send_message( send_message_args, ); - log::info!( + tracing::info!( target: LOG_TARGET_BRIDGE_DISPATCH, "haul_blob result - ok: {:?} on lane: {:?}. Enqueued messages: {}", artifacts.nonce, diff --git a/runtime/src/xcm_config.rs b/runtime/src/xcm_config.rs index 589226d4..f2e816a0 100644 --- a/runtime/src/xcm_config.rs +++ b/runtime/src/xcm_config.rs @@ -99,7 +99,7 @@ impl ConvertOrigin for KawabungaParachainAsRoot { kind: OriginKind, ) -> Result { let origin = origin.into(); - log::trace!( + tracing::trace!( target: "xcm::origin_conversion", "KawabungaParachainAsRoot origin: {origin:?}, kind: {kind:?}", ); @@ -148,7 +148,7 @@ impl> ShouldExecute max_weight: Weight, _properties: &mut xcm_executor::traits::Properties, ) -> Result<(), ProcessMessageError> { - log::trace!( + tracing::trace!( target: "xcm::barriers", "AllowUnpaidTransactsFrom origin: {origin:?}, instructions: {instructions:?}, max_weight: {max_weight:?}, properties: {_properties:?}", @@ -247,7 +247,7 @@ impl DispatchBlob for ImmediateXcmDispatcher { let message: Xcm = message.try_into().map_err(|_| DispatchBlobError::UnsupportedXcmVersion)?; - log::trace!( + tracing::trace!( target: "runtime::xcm", "Going to dispatch XCM message from {:?}: {:?}", KawabungaLocation::get(), @@ -270,7 +270,7 @@ impl DispatchBlob for ImmediateXcmDispatcher { ) .ensure_complete() .map_err(|e| { - log::trace!( + tracing::trace!( target: "runtime::xcm", "XCM message from {:?} was dispatched with an error: {:?}", KawabungaLocation::get(), diff --git a/runtimes/bulletin-polkadot/Cargo.toml b/runtimes/bulletin-polkadot/Cargo.toml index 59afd386..503bce8d 100644 --- a/runtimes/bulletin-polkadot/Cargo.toml +++ b/runtimes/bulletin-polkadot/Cargo.toml @@ -13,7 +13,7 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] codec = { workspace = true, features = ["derive"] } -log = { workspace = true } +tracing = { workspace = true } scale-info = { features = ["derive"], workspace = true } serde_json = { features = ["alloc"], workspace = true } frame-executive = { workspace = true } @@ -105,7 +105,7 @@ sp-tracing = { workspace = true } default = ["std"] std = [ "codec/std", - "log/std", + "tracing/std", "scale-info/std", "serde_json/std", diff --git a/runtimes/bulletin-polkadot/src/polkadot_bridge_config.rs b/runtimes/bulletin-polkadot/src/polkadot_bridge_config.rs index 66dbf180..59d50d3f 100644 --- a/runtimes/bulletin-polkadot/src/polkadot_bridge_config.rs +++ b/runtimes/bulletin-polkadot/src/polkadot_bridge_config.rs @@ -262,7 +262,7 @@ impl payload, Err(e) => { - log::error!( + tracing::error!( target: LOG_TARGET_BRIDGE_DISPATCH, "dispatch - payload error: {e:?} for lane_id: {:?} and message_nonce: {:?}", message.key.lane_id, @@ -276,7 +276,7 @@ impl { - log::debug!( + tracing::debug!( target: LOG_TARGET_BRIDGE_DISPATCH, "dispatch - `DispatchBlob::dispatch_blob` was ok for lane_id: {:?} and message_nonce: {:?}", message.key.lane_id, @@ -285,7 +285,7 @@ impl { - log::error!( + tracing::error!( target: LOG_TARGET_BRIDGE_DISPATCH, "dispatch - `DispatchBlob::dispatch_blob` failed with error: {e:?} for lane_id: {:?} and message_nonce: {:?}", message.key.lane_id, @@ -401,7 +401,7 @@ where XCM_LANE, &blob, ) .map_err(|e| { - log::error!( + tracing::error!( target: LOG_TARGET_BRIDGE_DISPATCH, "haul_blob result - error: {e:?} on lane: {XCM_LANE:?}", ); @@ -410,7 +410,7 @@ where let artifacts = pallet_bridge_messages::Pallet::::send_message( send_message_args, ); - log::info!( + tracing::info!( target: LOG_TARGET_BRIDGE_DISPATCH, "haul_blob result - ok: {:?} on lane: {:?}. Enqueued messages: {}", artifacts.nonce, diff --git a/runtimes/bulletin-polkadot/src/xcm_config.rs b/runtimes/bulletin-polkadot/src/xcm_config.rs index 0d0e6f2c..51748823 100644 --- a/runtimes/bulletin-polkadot/src/xcm_config.rs +++ b/runtimes/bulletin-polkadot/src/xcm_config.rs @@ -159,7 +159,7 @@ impl, Call, AsOrigin: Get> SendXcm Ok((Xcm::::from(msg), Assets::new())) }, _ => { - log::trace!( + tracing::trace!( target: "xcm::execute::validate", "ImmediateExecutingXcmRouter unsupported destination: {dest:?}", ); @@ -186,7 +186,7 @@ impl, Call, AsOrigin: Get> SendXcm .ensure_complete() .map(|_| message_hash) .map_err(|e| { - log::trace!( + tracing::trace!( target: "xcm::execute::deliver", "XCM message from {:?} was dispatched with an error: {:?}", AsOrigin::get(), diff --git a/runtimes/bulletin-polkadot/tests/tests.rs b/runtimes/bulletin-polkadot/tests/tests.rs index 1d2606c1..81580a4f 100644 --- a/runtimes/bulletin-polkadot/tests/tests.rs +++ b/runtimes/bulletin-polkadot/tests/tests.rs @@ -298,7 +298,7 @@ fn construct_and_apply_extrinsic( let dispatch_info = call.get_dispatch_info(); let xt = construct_extrinsic(account, call)?; let xt_len = xt.encode().len(); - log::info!( + tracing::info!( "Applying extrinsic: class={:?} pays_fee={:?} weight={:?} encoded_len={} bytes", dispatch_info.class, dispatch_info.pays_fee, @@ -344,7 +344,7 @@ fn transaction_storage_runtime_sizes() { // store data for (index, size) in sizes.into_iter().enumerate() { - log::info!("Storing data with size: {size} and index: {index}"); + tracing::info!("Storing data with size: {size} and index: {index}"); advance_block(); let res = construct_and_apply_extrinsic( account.pair(),