Skip to content

Conversation

@timabrmsn
Copy link
Contributor

code42cli.output_formats.OutputFormatter.echo_formatted_generated_output() was initially added because the audit-logs command processed events for checkpointing as a generator, and the thought was that if an error occurred halfway through sending events to the terminal, we'd only have checkpointed the most recent one sent.

However, the JSON, RAW-JSON, and CSV formatters weren't really designed with generators in mind, and thus they don't work with the current echo_formatted_generated_output().

I'm simply reverting to calling list() on the generator prior to printing the output, so that formatting is no longer broken when using --use-checkpoint. I'd like to do some larger refactoring of output formats to handle generators down the line, but that work is too big for right now.

@timabrmsn timabrmsn requested a review from a team as a code owner September 13, 2021 20:34
@github-actions
Copy link

github-actions bot commented Sep 13, 2021

CLA Assistant Lite bot All contributors have signed the CLA ✍️

@timabrmsn timabrmsn merged commit 81600c6 into main Sep 13, 2021
@timabrmsn timabrmsn deleted the bugfix/auditlogs_checkpoint_formatting branch September 13, 2021 21:05
@github-actions github-actions bot locked and limited conversation to collaborators Sep 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants