This is one of the things that would really help me on occasion. Debug
is really great, and the {:#?}
alt version can help with moderately complex output, but when you are dumping really big structs to stdout, the output becomes unwieldy and hard to manage/navigate.
A few solutions come to mind:
- use
serde
and serialize to your favorite output type. This requires a big dependency and that all structs are annotatedSerialize
. - Parse the textual output from
Debug
. There will be times when this fails (when the user implements debug themselves and deviates from the common patterns). It also requires work.
Is this a problem that other people have? How do you solve it? Is there an appetite for a Debug
output parser?