Add a formatter to json
To aid debugging or storing a readable file, some sort of formatter is needed.
@michalmuskala
CT Test Results
2 files 95 suites 35m 54s :stopwatch: 2 145 tests 2 097 :white_check_mark: 48 :zzz: 0 :x: 2 454 runs 2 404 :white_check_mark: 50 :zzz: 0 :x:
Results for commit 17cbbf82.
:recycle: This comment has been updated with latest results.
To speed up review, make sure that you have read Contributing to Erlang/OTP and that all checks pass.
See the TESTING and DEVELOPMENT HowTo guides for details about how to run test locally.
Artifacts
// Erlang/OTP Github Action Bot
We often use ~0p when printing terms during debugging. This because the indent can greatly increase data size and kill performance (or the node). An equivalent for the JSON formatter would be appreciated. We can always pretty print it in an editor or on the command line later on if necessary.
The default encode/[1,2] already does that, i.e. creates a "string" without adding any whitespace characters?
This is a 50% slower and (memory consuming) variant for when you want print it formatted in the shell or file. Or do I not understand your comment?
My bad I must not have completely woke up today. Please disregard my comment!