-
Notifications
You must be signed in to change notification settings - Fork 66
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
Render Stellar Events as JSON Instead of Rust Debug Format and Update WASM Path #1642
base: main
Are you sure you want to change the base?
Render Stellar Events as JSON Instead of Rust Debug Format and Update WASM Path #1642
Conversation
ready for review: @leighmcculloch, please tell me if there a telegram group instead of the discord for more fluent conversation about this issue please |
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.
Hi @juandiegocv27, thanks for contributing.
See my comments inline.
cmd/soroban-cli/src/log/event.rs
Outdated
let xdr = event.to_xdr_base64(xdr::Limits::none()).unwrap(); | ||
// Convert the event to JSON | ||
let json = serde_json::to_string(event).unwrap(); | ||
|
||
if span.metadata().unwrap().level() == &Level::INFO { | ||
info!("{i}: {xdr} {json}"); | ||
info!("{i}: {json}"); | ||
} else { | ||
debug!("{i}: {xdr} {json}"); | ||
debug!("{i}: {json}"); |
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.
This output is part of the logging and it was just recently written to output both the XDR and the JSON in the following issue. We want to keep it as is:
The issue being addressed by this PR is to change the stdout output of the stellar contract events
subcommand, not the log output. If you see the original issue the original issue has an example of what the command is to run, and what the output looks like today. It's that output that the issue describes being changed from Rust debug format to JSON.
thank you for the feedback, I'll fix the issues 🫡 |
@leighmcculloch make the changes and implement some new code, please review and let me know |
tell what to fix to do solve the problem as fast as possible or if its ready to merge |
What
This PR modifies the Stellar events output to render as JSON instead of using the Rust debug format. Additionally, it updates the path in
boilerplate.rs
for including the WASM file.Why
The change is being made because developers are more familiar with the JSON format, which provides a standardized way of viewing event data. It aligns with Render events as json in stellar events pretty output instead of as rust debug issue, aiming to improve the readability and usability of the event logs for developers.