-
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -18,7 +18,6 @@ extern crate alloc; | |||||
|
|
||||||
| pub use array_bytes; | ||||||
| pub use codec::{Decode, Encode, EncodeLike, MaxEncodedLen}; | ||||||
| pub use log; | ||||||
| pub use paste; | ||||||
| pub use std::{ | ||||||
| any::type_name, | ||||||
|
|
@@ -29,6 +28,7 @@ pub use std::{ | |||||
| ops::Deref, | ||||||
| sync::{Arc, LazyLock, Mutex}, | ||||||
| }; | ||||||
| pub use tracing; | ||||||
|
|
||||||
| // Substrate | ||||||
| pub use alloc::collections::vec_deque::VecDeque; | ||||||
|
|
@@ -552,7 +552,7 @@ macro_rules! __impl_test_ext_for_relay_chain { | |||||
|
|
||||||
| // Execute | ||||||
| let r = $local_ext.with(|v| { | ||||||
| $crate::log::info!(target: "xcm::emulator::execute_with", "Executing as {}", stringify!($name)); | ||||||
| $crate::tracing::info!(target: "xcm::emulator::execute_with", "Executing as {}", stringify!($name)); | ||||||
| v.borrow_mut().execute_with(execute) | ||||||
| }); | ||||||
|
|
||||||
|
|
@@ -578,7 +578,7 @@ macro_rules! __impl_test_ext_for_relay_chain { | |||||
|
|
||||||
| // 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); | ||||||
| }); | ||||||
|
|
||||||
| // clean events | ||||||
|
|
@@ -904,7 +904,7 @@ macro_rules! __impl_test_ext_for_parachain { | |||||
|
|
||||||
| // Execute | ||||||
| let r = $local_ext.with(|v| { | ||||||
| $crate::log::info!(target: "xcm::emulator::execute_with", "Executing as {}", stringify!($name)); | ||||||
| $crate::tracing::info!(target: "xcm::emulator::execute_with", "Executing as {}", stringify!($name)); | ||||||
| v.borrow_mut().execute_with(execute) | ||||||
| }); | ||||||
|
|
||||||
|
|
@@ -952,7 +952,7 @@ macro_rules! __impl_test_ext_for_parachain { | |||||
|
|
||||||
| // 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); | ||||||
|
||||||
| $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
Outdated
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
Outdated
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
Outdated
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
Outdated
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
Outdated
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| title: Replace `log` with `tracing` on `xcm-emulator` | ||
| doc: | ||
| - audience: Runtime Dev | ||
| description: This PR replaces `log` with `tracing` instrumentation on `xcm-emulator` | ||
| by providing structured logging. | ||
| crates: | ||
| - name: xcm-emulator | ||
| bump: minor |
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.
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