TylerBrock/saw

Does not preserve json property order

joeflateau opened this issue · 2 comments

Json objects in logs have their properties reordered alphabetically instead of as logged.

Log

{ "b":1, "c":1, "a":1 }

Will print

{ "a":1, "b":1, "c":1 }

I don't know if it's a bug or a feature to be honest.

The problem is in https://github.com/TylerBrock/colorjson, tl;dr it's an expected behaviour of that Marshaller to reorder the keys.

@TylerBrock it could be a nice feature for colorjson to have a flag for reorder or not (it could improve performance on big JSON) and you could put it also as a config flag here

@TylerBrock if it's considered a bug (or a nice enhancement) I would like to work on it on both projects