Skip to content

JSON-Output Option for stdout.#116

Open
Ra0R wants to merge 7 commits into
wolfgangw:masterfrom
Ra0R:master
Open

JSON-Output Option for stdout.#116
Ra0R wants to merge 7 commits into
wolfgangw:masterfrom
Ra0R:master

Conversation

@Ra0R
Copy link
Copy Markdown

@Ra0R Ra0R commented Mar 24, 2026

Hey there, I implemented a JSON-Output option to stdout.

Feel free to pull it if it fits the project. I left a todo, in case the output should also be written to a logfile. But I didn't want to change too much.

Comment thread dcp_inspect Outdated
Comment thread dcp_inspect
:info => inspection[ :info ],
}
puts JSON.pretty_generate( payload )
exit inspection[ :errors ].size == 0 ? DCP_OK : DCP_ERROR
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exiting here would leave @dcp_inspect_tmp dangling

Comment thread dcp_inspect
end
if options.json_output
options.verbosity = [ 'quiet' ]
# TODO: Or should the JSON output be written to a file instead of stdout? Then we could have autolog and logfile options for JSON output as well.
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, should reuse the autolog and logfile mechanisms

@wolfgangw
Copy link
Copy Markdown
Owner

Renato, hi and thanks, I like it.

Can I ask, are you using dcp_inspect yourself?

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.

2 participants