Replace log with tracing on xcm-emulator#9409
Merged
raymondkfcheung merged 3 commits intomasterfrom Aug 4, 2025
Merged
Conversation
bkchr
approved these changes
Jul 31, 2025
cumulus/xcm/xcm-emulator/src/lib.rs
Outdated
| // log events | ||
| <Self as $crate::Chain>::events().iter().for_each(|event| { | ||
| $crate::log::info!(target: concat!("events::", stringify!($name)), "{:?}", event); | ||
| $crate::tracing::info!(target: concat!("events::", stringify!($name)), "{:?}", event); |
Member
There was a problem hiding this comment.
Suggested change
| $crate::tracing::info!(target: concat!("events::", stringify!($name)), "{:?}", event); | |
| $crate::tracing::info!(target: concat!("events::", stringify!($name)), ?event, "Event processed"); |
cumulus/xcm/xcm-emulator/src/lib.rs
Outdated
| (*block, $crate::array_bytes::bytes2hex("0x", message)) | ||
| }).collect::<Vec<_>>(); | ||
| $crate::log::info!(target: concat!("xcm::dmp::", stringify!($name)) , "Downward messages processed by para_id {:?}: {:?}", &to_para_id, messages); | ||
| $crate::tracing::info!(target: concat!("xcm::dmp::", stringify!($name)) , "Downward messages processed by para_id {:?}: {:?}", &to_para_id, messages); |
Member
There was a problem hiding this comment.
Suggested change
| $crate::tracing::info!(target: concat!("xcm::dmp::", stringify!($name)) , "Downward messages processed by para_id {:?}: {:?}", &to_para_id, messages); | |
| $crate::tracing::info!(target: concat!("xcm::dmp::", stringify!($name)) , ?to_para_id, ?messages, "Downward messages processed"); |
cumulus/xcm/xcm-emulator/src/lib.rs
Outdated
| (*para_id, *relay_block_number, $crate::array_bytes::bytes2hex("0x", message)) | ||
| }).collect::<Vec<_>>(); | ||
| $crate::log::info!(target: concat!("xcm::hrmp::", stringify!($name)), "Horizontal messages processed by para_id {:?}: {:?}", &to_para_id, &messages); | ||
| $crate::tracing::info!(target: concat!("xcm::hrmp::", stringify!($name)), "Horizontal messages processed by para_id {:?}: {:?}", &to_para_id, &messages); |
Member
There was a problem hiding this comment.
Suggested change
| $crate::tracing::info!(target: concat!("xcm::hrmp::", stringify!($name)), "Horizontal messages processed by para_id {:?}: {:?}", &to_para_id, &messages); | |
| $crate::tracing::info!(target: concat!("xcm::hrmp::", stringify!($name)), ?to_para_id, ?messages, "Horizontal messages processed"); |
cumulus/xcm/xcm-emulator/src/lib.rs
Outdated
| }); | ||
| let message = $crate::array_bytes::bytes2hex("0x", msg.clone()); | ||
| $crate::log::info!(target: concat!("xcm::ump::", stringify!($name)) , "Upward message processed from para_id {:?}: {:?}", &from_para_id, &message); | ||
| $crate::tracing::info!(target: concat!("xcm::ump::", stringify!($name)) , "Upward message processed from para_id {:?}: {:?}", &from_para_id, &message); |
Member
There was a problem hiding this comment.
Suggested change
| $crate::tracing::info!(target: concat!("xcm::ump::", stringify!($name)) , "Upward message processed from para_id {:?}: {:?}", &from_para_id, &message); | |
| $crate::tracing::info!(target: concat!("xcm::ump::", stringify!($name)) , ?from_para_id, ?message, "Upward message processed"); |
cumulus/xcm/xcm-emulator/src/lib.rs
Outdated
| <<Self::Bridge as Bridge>::Handler as BridgeMessageHandler>::notify_source_message_delivery(msg.lane_id.clone()); | ||
| }); | ||
| $crate::log::info!(target: concat!("bridge::", stringify!($name)) , "Bridged message processed {:?}", msg); | ||
| $crate::tracing::info!(target: concat!("bridge::", stringify!($name)) , "Bridged message processed {:?}", msg); |
Member
There was a problem hiding this comment.
Suggested change
| $crate::tracing::info!(target: concat!("bridge::", stringify!($name)) , "Bridged message processed {:?}", msg); | |
| $crate::tracing::info!(target: concat!("bridge::", stringify!($name)) , ?msg, "Bridged message processed"); |
cumulus/xcm/xcm-emulator/src/lib.rs
Outdated
| // Log all events (since they won't be logged after the panic). | ||
| <$chain as $crate::Chain>::events().iter().for_each(|event| { | ||
| $crate::log::info!(target: concat!("events::", stringify!($chain)), "{:?}", event); | ||
| $crate::tracing::info!(target: concat!("events::", stringify!($chain)), "{:?}", event); |
Member
There was a problem hiding this comment.
Suggested change
| $crate::tracing::info!(target: concat!("events::", stringify!($chain)), "{:?}", event); | |
| $crate::tracing::info!(target: concat!("events::", stringify!($chain)), event, "Event processed"); |
cumulus/xcm/xcm-emulator/src/lib.rs
Outdated
| // log events | ||
| Self::events().iter().for_each(|event| { | ||
| $crate::log::info!(target: concat!("events::", stringify!($name)), "{:?}", event); | ||
| $crate::tracing::info!(target: concat!("events::", stringify!($name)), "{:?}", event); |
Member
There was a problem hiding this comment.
Suggested change
| $crate::tracing::info!(target: concat!("events::", stringify!($name)), "{:?}", event); | |
| $crate::tracing::info!(target: concat!("events::", stringify!($name)), ?event, "Event processed"); |
x3c41a
approved these changes
Aug 4, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR replaces
logwithtracinginstrumentation onxcm-emulatorby providing structured logging.Continues #8732