Skip to content
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

Pretty print metadata in debug persisted CLI #152

Closed
jopemachine opened this issue Oct 6, 2024 · 0 comments · Fixed by #159
Closed

Pretty print metadata in debug persisted CLI #152

jopemachine opened this issue Oct 6, 2024 · 0 comments · Fixed by #159
Labels
cli feature New feature or request good first issue Good for newcomers

Comments

@jopemachine
Copy link
Member

jopemachine commented Oct 6, 2024

After #151, Log entries are now pretty-printed in table format.
However, the metadata is still being output in raw.

I'm not sure if it's appropriate to present the metadata in table format, but we can improve the readability compared to the current state.

For example,

+-----------+-----------------------------------+----------------+
| Category  | Field                             | Value          |
+-----------+-----------------------------------+----------------+
| HardState | term                              | 1              |
|           | vote                              | 2              |
|           | commit                            | 1              |
+-----------+-----------------------------------+----------------+
| ConfState | voters                            | [2, 3, 1]      |
|           | learners                          | []             |
|           | voters_outgoing                   | []             |
|           | learners_next                     | []             |
|           | auto_leave                        | false          |
+-----------+-----------------------------------+----------------+
| Snapshot  | data                              | []             |
|           | metadata                          |                |
|           | ├─ conf_state                     |                |
|           | │  ├─ voters                      | [2, 3, 1]      |
|           | │  ├─ learners                    | []             |
|           | │  ├─ voters_outgoing             | []             |
|           | │  ├─ learners_next               | []             |
|           | │  └─ auto_leave                  | false          |
|           | ├─ index                          | 0              |
|           | └─ term                           | 0              |
+-----------+-----------------------------------+----------------+
| LastIndex | last index                        | 1              |
+-----------+-----------------------------------+----------------+
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli feature New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant