Skip to content

Make list output to stdout - #45

Draft
mig4 wants to merge 1 commit into
opsgenie:masterfrom
mig4:list-to-stdout
Draft

mig4 wants to merge 1 commit into
opsgenie:masterfrom
mig4:list-to-stdout

Conversation

@mig4

@mig4 mig4 commented Jul 30, 2021

Copy link
Copy Markdown

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

mig4 commented Jul 30, 2021

Copy link
Copy Markdown
Author

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

mig4 commented Jul 30, 2021

Copy link
Copy Markdown
Author

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