hashicorp / terraform-plugin-go

A low-level Go binding for the Terraform protocol for integrations to be built on top of.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Logging wrappers aren't passing pairs correctly

jimsnab opened this issue · comments

terraform-plugin-go version

https://github.com/hashicorp/terraform-plugin-go/commit/930a5174615ae887b313f85ed5cb87cd51849170

Relevant provider source code

// ProtocolError emits a protocol subsystem log at ERROR level.
func ProtocolError(ctx context.Context, msg string, args ...interface{}) {
	tfsdklog.SubsystemError(ctx, SubsystemProto, msg, args)
}

// ProtocolTrace emits a protocol subsystem log at TRACE level.
func ProtocolTrace(ctx context.Context, msg string, args ...interface{}) {
	tfsdklog.SubsystemTrace(ctx, SubsystemProto, msg, args)
}

Terraform Configuration Files

# insert config here

Expected Behavior

grpc logged smoothly

Actual Behavior

noisy logging, in particular EXTRA_VALUE_AT_END=<nil> because args aren't passed through properly

Code is missing ...

tfsdklog.SubsystemError(ctx, SubsystemProto, msg, args...)

Steps to Reproduce

export TF_LOG=trace
terraform apply

References

Hi @jimsnab 👋 Thanks for reporting this. It's being addressed imminently via hashicorp/terraform-plugin-log#30 and hashicorp/terraform-plugin-log#31 and will be fixed in the next release of this project.