Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make list output to stdout #45

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

Conversation

mig4
Copy link

@mig4 mig4 commented Jul 30, 2021

List commands are producing JSON/YAML output and this allows piping it
to the likes of jq/yq for further processing.

List commands are producing JSON/YAML output and this allows piping it
to the likes of jq/yq for further processing.
@mig4
Copy link
Author

mig4 commented Jul 30, 2021

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.

@mig4
Copy link
Author

mig4 commented Jul 30, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant