Open mtoman opened 11 years ago
The whitespace is pretty much hardcoded in the json output procedures (surely can be stripped though).
sr_report_to_json_no_whitespace
or sr_report_to_json_ext(report, flags)
. Or providing a function for stripping whitespace from json string?reporter-ureport
)sr_report_to_json
and sr_report_to_nice_json
or sr_report_to_short_json
Note to future self: work in progress regarding this ticket has been pushed to branch gh104-smaller-ureport
.
Well, I'd rather work up a bit more systematic and reliable solution instead of removing redundant white space from JSON formatted text :) How about to stop insisting on the design where JSON is the only supported output format?
Care to elaborate? IMHO, the current design does not in any way prevent adding support for other output formats.
I agree that removing the white space after the JSON-formatted text is generated is retarded, but it is the least time-consuming approach due to the nature of the formatting code.
At the moment satyr generates a nicely indented uReport, which is perfectly human-readable, but a little non-practical for sending over network. For example the following uReport contains 50% of unnecessary white spaces (satyr generates 35686 bytes, json.dumps() for the very same report only gives 17843)