Skip to content

Conversation

@larhauga
Copy link

@larhauga larhauga commented Feb 28, 2025

Description of your changes

This change will provide debug logging in json format instead of go string. This will help when debugging why changes are not affected as this may be the only way you can figure out the different quirks of the cloud provider APIs.

This will remove type information from the output logs, but it will be parsable.

Fixes #

I have:

  • Read and followed Upjet's contribution process.
  • Run make reviewable to ensure this PR is ready for review.
  • Added backport release-x.y labels to auto-backport this PR if necessary.

How has this code been tested

Printed out the new format during test run.

2025-02-28T17:39:20+01:00       DEBUG   provider-aws    Diff detected   
{"instanceDiff": "{\"attributes\":
{\"name\":
{\"Old\":\"example2\",
\"New\":\"example\",
\"NewComputed\":false,
\"NewRemoved\":false,
\"NewExtra\":null,
\"RequiresNew\":false,
\"Sensitive\":false,
\"Type\":0}},
\"destroy\":false,
\"destroyTainted\":false,
\"destroyDeposed\":false}"}
2025-02-28T17:40:28+01:00       DEBUG   provider-aws    Diff detected   
{"instanceDiff": "*terraform.InstanceDiff{mu:sync.Mutex{state:0, sema:0x0}, Attributes:map[string]*terraform.ResourceAttrDiff{
\"name\":*terraform.ResourceAttrDiff{
Old:\"example2\", New:\"example\", 
NewComputed:false, NewRemoved:false, 
NewExtra:interface {}(nil), RequiresNew:false, 
Sensitive:false, Type:0x0}}, Destroy:false, 
DestroyDeposed:false, DestroyTainted:false, 
RawConfig:cty.NilVal, RawState:cty.NilVal, 
RawPlan:cty.NilVal, Meta:map[string]interface {}(nil)}"}

Copy link
Contributor

@mbbush mbbush left a comment

Choose a reason for hiding this comment

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

This would be a very welcome improvement. Thanks!

@stevendborrelli
Copy link
Member

@larhauga can you update this PR based on the feedback on needing an else clause?

@larhauga
Copy link
Author

@larhauga can you update this PR based on the feedback on needing an else clause?

Sorry for the delay! Added the else clause now :)

@larhauga larhauga requested a review from mbbush June 20, 2025 05:23
@jeanduplessis jeanduplessis reopened this Aug 20, 2025
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.

4 participants