-
Notifications
You must be signed in to change notification settings - Fork 524
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
Comments
Marking as an enhancement. This could be quite nice. |
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. |
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. |
Hi, |
@MatthiasKauer We would be happy accepting a PR for this. |
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.
The text was updated successfully, but these errors were encountered: