Skip to content

feat(example_wallet_rpc): enhance logging with structured JSON output #216

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

SharanRP
Copy link

Description

Enhanced the example_wallet_rpc to output information in JSON format instead of plain text. This change makes it easier to extract and process information using tools like jq, improving integration with shell scripts and external CLI tools.

Key changes:

  • Added JSON structured output for all logging/status messages
  • Added event types to distinguish different output messages
  • Maintained all existing functionality while only changing the output format
  • Added serde_json dependency for JSON serialization

Notes to the reviewers

The change is minimal and non-breaking - all the same information is being output, just in a structured JSON format. Each message includes an "event" field to easily identify the type of output, making it simpler to filter and process specific information.

The JSON format was chosen over other structured formats (like YAML) because:

  1. It's widely supported across all platforms
  2. Has excellent tooling support (jq, python json, etc.)
  3. Is easily parseable by most programming languages
  4. Maintains human readability with pretty printing

Changelog notice

Added:

  • JSON structured output format for example_wallet_rpc, enabling better integration with external tools and scripts

Checklists

All Submissions:

  • I've signed all my commits
  • I followed the contribution guidelines
  • I ran cargo fmt and cargo clippy before committing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant