-
Notifications
You must be signed in to change notification settings - Fork 1k
Replace log
with tracing
on xcm-emulator
#9409
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$crate::tracing::info!(target: concat!("events::", stringify!($name)), "{:?}", event); | |
$crate::tracing::info!(target: concat!("events::", stringify!($name)), ?event, "Event processed"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed
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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$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"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed
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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$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"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed
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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$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"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed
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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$crate::tracing::info!(target: concat!("bridge::", stringify!($name)) , "Bridged message processed {:?}", msg); | |
$crate::tracing::info!(target: concat!("bridge::", stringify!($name)) , ?msg, "Bridged message processed"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed
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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$crate::tracing::info!(target: concat!("events::", stringify!($chain)), "{:?}", event); | |
$crate::tracing::info!(target: concat!("events::", stringify!($chain)), event, "Event processed"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed
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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$crate::tracing::info!(target: concat!("events::", stringify!($name)), "{:?}", event); | |
$crate::tracing::info!(target: concat!("events::", stringify!($name)), ?event, "Event processed"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed
This PR replaces
log
withtracing
instrumentation onxcm-emulator
by providing structured logging.Continues #8732