Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Delete
invocation_id
log field when streaming plugins logs (#366)
#### Summary Part of cloudquery/cloudquery#18443. Both CLI and plugins add the invocation ID field to the log. When the CLI invokes plugins it streams their logs into its own log so it all shows up in the same file. This happens here https://github.com/cloudquery/plugin-pb-go/blob/28fae3fab7dd225622fdea542ae67ee5649e8b8c/managedplugin/plugin.go#L480 We parse the log line as JSON, then log it with the CLI logger. `zerolog` doesn't remove duplicate fields (see https://github.com/rs/zerolog?tab=readme-ov-file#field-duplication ) we need to remove the duplicate ourselves (similar to `level`). Please note that the duplicates only show up when passing `--log-format json` as it seems the text format does remove duplicates (`zerolog` saves the message to be printed internally in JSON format so probably the conversion to text removes the duplicate somewhere, didn't both to check). CLI PR in cloudquery/cloudquery#18641 ---
- Loading branch information