RedHatInsights / yggdrasil

GNU General Public License v3.0
21 stars 37 forks source link

feat: Pretty-print messages #173

Closed m-horky closed 9 months ago

m-horky commented 11 months ago

Structs defined in messages.go will now be ASCII-printed if they contain text data. If non-printable bytes are received, raw bytes (the previous default) are printed as a fallback.

subpop commented 11 months ago

I'm still not sure how I feel about the custom Stringer implementations. I know that the message types are unlikely to change, but having a custom String() function feels like unnecessary overhead. I think I'd rather we print the message types as JSON than as a custom, almost-JSON-but-not-quite format.