-
Notifications
You must be signed in to change notification settings - Fork 352
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
Hermes: replace default JSON with human-readable output #796
Conversation
imho whether or not we output JSON should be a global command-line flag (available on every commands) rather than a config option, otherwise if one wants to use the CLI programmatically (either in a script or in the e2e test suite) one has to ensure that the config file contains the proper value for I wonder if we could do this by defining our own [ What do you think? |
@@ -13,7 +13,6 @@ authors = [ | |||
|
|||
description = """ | |||
Implementation of `hermes`, an IBC Relayer developed in Rust. | |||
This crate is a CLI wrapper over the `ibc-relayer` library. |
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.
👍
Codecov Report
@@ Coverage Diff @@
## master #796 +/- ##
=========================================
+ Coverage 13.6% 45.0% +31.3%
=========================================
Files 69 165 +96
Lines 3752 11309 +7557
Branches 1374 0 -1374
=========================================
+ Hits 513 5090 +4577
- Misses 2618 6219 +3601
+ Partials 621 0 -621
Continue to review full report at Codecov.
|
Looks great, thanks @adizere! One last thing I wonder now that I am looking at an example: in the human-readable case (ie. when Just a thought, based on a personal preference. What do you think? |
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.
The result of command and raw txs is different: E.g., create channel will print "Channel handshake finished for Channel{ ... } " in a different style than the "Success" message.
Status of this PR as of commit a35a225:
The feature of having debug and trace logging appeared to be useful in debugging recent work (#747). |
This reverts commit 4dd8982. The commit was mistakenly pushed on the wrong branch.
…ems#796) * Added log_json flag to config * Add missing JSON flag for CI workflow * One more toml config file * Introduce custom-made EntryPoint * Tracing with custom writer to ensure stderr output. h/t @romac * JSON-aware output in conclude.rs * Enabled json output in e2e suite * Switch to pretty formatter when JSON is off. * Replaced the clumsy impl of json() with more direct approach h/t @romac. * More explicit json flag in e2e * changelog * Cleanup * More cleanup * Use human-readable output for the final output result when JSON output is disabled * Enabled tracing filter by crate. Added custom pretty tracing component. * Replace /tx raw create-client/ with /create client/ * Revert "Replace /tx raw create-client/ with /create client/" This reverts commit 4dd8982. The commit was mistakenly pushed on the wrong branch. Co-authored-by: Romain Ruetschi <[email protected]>
Closes: #805
Many thanks @romac for code snippets & helping with navigating the code around abscissa!
Description
Primary change in this PR:
-j
/--json
flag to enable output in JSON format:versus pretty-printing (the default):
Notable code changes in this PR:
abscissa::EntryPoint
with out customEntryPoint
inrelayer-cli/src/entry.rs
per suggestion;-j
or--json
to enable JSON only output (default is pretty printing)-v
verbose parameterjson()
method inconclude.rs
to peek into the application state and infer if JSON output should be on or offrelayer-cli/build.rs
hermes
(the binary name) instead ofibc-relayer-cli
(the crate name)For contributor use:
docs/
) and code comments.Files changed
in the Github PR explorer.