[xcm-emulator] Better logs for message execution and processing (#5712)
When running XCM emulated tests and seeing the logs with `RUST_LOG=xcm` or `RUST_LOG=xcm=trace`, it's sometimes a bit hard to figure out the chain where the logs are coming from. I added a log whenever `execute_with` is called, to know the chain which makes the following logs. Looks like so: <img width="1499" alt="Screenshot 2024-09-13 at 20 14 13" src="https://github.com/user-attachments/assets/a31d7aa4-11d1-4d3e-9a65-86f38347c880"> There are already log targets for when UMP, DMP and HRMP messages are being processed. To see them, you have to use the log targets `ump`, `dmp`, and `hrmp` respectively. So `RUST_LOG=xcm,ump,dmp,hrmp` would let you see every log. I prefixed the targets with `xcm::` so you can get all the relevant logs just by filtering by `xcm`. You can always use the whole target to see just the messages being processed. These logs showed the message as an array of bytes, I made them show a hexadecimal string instead since that's easier to copy in case you want to decode it or use it in another tool. They look like this now: <img width="1499" alt="Screenshot 2024-09-13 at 20 17 15" src="https://github.com/user-attachments/assets/5abf4a97-1ea7-4832-b3b0-d54c54905d1a"> The HRMP and UMP ones are very similar. (cherry picked from commit b230b0e3)
Please register or sign in to comment