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

[C++] Generate message pretty printers #178

Closed
arnetheduck opened this issue Jun 25, 2014 · 5 comments
Closed

[C++] Generate message pretty printers #178

arnetheduck opened this issue Jun 25, 2014 · 5 comments

Comments

@arnetheduck
Copy link

It would be very convenient if the generated code could also pretty print (to string, ostream or whatever) in some suitable name=value format (FIX, json, protobuf ShortDebugString to name a few candidates), for debugging / logging purposes.

@tmontgomery
Copy link
Contributor

Marking as an enhancement. This could be quite nice.

@donmendelson
Copy link

For debugging, essential features for pretty print include printing symbolic names for enum values and bits of a bitset.

More broadly, useful interpretation of an encoding requires knowing its semanticType (application layer class). For example, a decimal is encoded as a composite type of mantissa and exponent. The print function should not show it as two separate elements, but rather as a properly formatted decimal number with correct precision. Likewise, a UTCTimestamp field should be formatted as a data/time rather than the integer sent on the wire. This implies registering a toString() function for each semantic type or encoding.

@lcs777
Copy link
Contributor

lcs777 commented Sep 25, 2015

I dipped my toe in the water with PR #296 . I am thinking of expanding this work by adding the ability to print to an ostream (for enums, options, decimals) as well as having a toJson() method for each message, since JSON seems the most useful human readable encoding.

If anyone has any suggestions, please let me know.

@MatthiasKauer
Copy link

Hi,
I'm interested in working on this.
Is it still relevant? Is someone else working on it?

@mjpt777
Copy link
Contributor

mjpt777 commented Oct 2, 2017

@MatthiasKauer We would be happy accepting a PR for this.

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

No branches or pull requests

6 participants