Open mig4 opened 3 years ago
Hi, I wanted to start a discussion. I think the list commands should output to stdout instead of using logging, as this allows processing JSON/YAML output and constructing pipes, etc.
This is a proof-of-concept patch that implements that in listHeartbeats
command, if this approach is OK I'll extend it to other list commands.
Note that with this change the output won't be logged to file if that is enabled. If this should be preserved let me know and I'll rework it a bit.
Also a question from me, in CONTRIBUTING doc you mention running go fmt
/ goimports
, but current code doesn't seem to be formatted, so I reverted the changes from go fmt
/ goimports
as it made the diff too big.
If that's OK I can submit a separate PR first that re-formats the code and then re-base this one.
List commands are producing JSON/YAML output and this allows piping it to the likes of jq/yq for further processing.