Skip to content

Commit

Permalink
Bump github.com/hashicorp/terraform-plugin-log from 0.4.1 to 0.6.0 (#209
Browse files Browse the repository at this point in the history
)

* Bump github.com/hashicorp/terraform-plugin-log from 0.4.1 to 0.6.0

Bumps [github.com/hashicorp/terraform-plugin-log](https://github.com/hashicorp/terraform-plugin-log) from 0.4.1 to 0.6.0.
- [Release notes](https://github.com/hashicorp/terraform-plugin-log/releases)
- [Changelog](https://github.com/hashicorp/terraform-plugin-log/blob/main/CHANGELOG.md)
- [Commits](hashicorp/terraform-plugin-log@v0.4.1...v0.6.0)

---
updated-dependencies:
- dependency-name: github.com/hashicorp/terraform-plugin-log
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* internal/logging: Use SetField() instead of With()

* Update CHANGELOG for #209

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Brian Flad <bflad417@gmail.com>
  • Loading branch information
dependabot[bot] and bflad committed Jul 15, 2022
1 parent a6fc6ab commit 2ba77a5
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 19 deletions.
3 changes: 3 additions & 0 deletions .changelog/209.txt
@@ -0,0 +1,3 @@
```release-note:note
The underlying `terraform-plugin-log` dependency has been updated to v0.6.0, which includes log filtering support and breaking changes of `With()` to `SetField()` function names. Any provider logging which calls those functions may require updates.
```
2 changes: 1 addition & 1 deletion go.mod
Expand Up @@ -7,7 +7,7 @@ require (
github.com/hashicorp/go-hclog v1.2.1
github.com/hashicorp/go-plugin v1.4.4
github.com/hashicorp/go-uuid v1.0.3
github.com/hashicorp/terraform-plugin-log v0.4.1
github.com/hashicorp/terraform-plugin-log v0.6.0
github.com/hashicorp/terraform-registry-address v0.0.0-20220623143253-7d51757b572c
github.com/mitchellh/go-testing-interface v1.14.1
github.com/nsf/jsondiff v0.0.0-20200515183724-f29ed568f4ce
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Expand Up @@ -64,8 +64,8 @@ github.com/hashicorp/go-plugin v1.4.4/go.mod h1:viDMjcLJuDui6pXb8U4HVfb8AamCWhHG
github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8=
github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
github.com/hashicorp/terraform-plugin-log v0.4.1 h1:xpbmVhvuU3mgHzLetOmx9pkOL2rmgpu302XxddON6eo=
github.com/hashicorp/terraform-plugin-log v0.4.1/go.mod h1:p4R1jWBXRTvL4odmEkFfDdhUjHf9zcs/BCoNHAc7IK4=
github.com/hashicorp/terraform-plugin-log v0.6.0 h1:/Vq78uSIdUSZ3iqDc9PESKtwt8YqNKN6u+khD+lLjuw=
github.com/hashicorp/terraform-plugin-log v0.6.0/go.mod h1:p4R1jWBXRTvL4odmEkFfDdhUjHf9zcs/BCoNHAc7IK4=
github.com/hashicorp/terraform-registry-address v0.0.0-20220623143253-7d51757b572c h1:D8aRO6+mTqHfLsK/BC3j5OAoogv1WLRWzY1AaTo3rBg=
github.com/hashicorp/terraform-registry-address v0.0.0-20220623143253-7d51757b572c/go.mod h1:Wn3Na71knbXc1G8Lh+yu/dQWWJeFQEpDeJMtWMtlmNI=
github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734 h1:HKLsbzeOsfXmKNpr3GiT18XAblV0BjCbzL8KQAMZGa0=
Expand Down
32 changes: 16 additions & 16 deletions internal/logging/context.go
Expand Up @@ -10,9 +10,9 @@ import (

// DataSourceContext injects the data source type into logger contexts.
func DataSourceContext(ctx context.Context, dataSource string) context.Context {
ctx = tfsdklog.With(ctx, KeyDataSourceType, dataSource)
ctx = tfsdklog.SubsystemWith(ctx, SubsystemProto, KeyDataSourceType, dataSource)
ctx = tflog.With(ctx, KeyDataSourceType, dataSource)
ctx = tfsdklog.SetField(ctx, KeyDataSourceType, dataSource)
ctx = tfsdklog.SubsystemSetField(ctx, SubsystemProto, KeyDataSourceType, dataSource)
ctx = tflog.SetField(ctx, KeyDataSourceType, dataSource)

return ctx
}
Expand Down Expand Up @@ -41,16 +41,16 @@ func ProtoSubsystemContext(ctx context.Context, sdkOpts tfsdklog.Options) contex

// ProtocolVersionContext injects the protocol version into logger contexts.
func ProtocolVersionContext(ctx context.Context, protocolVersion string) context.Context {
ctx = tfsdklog.SubsystemWith(ctx, SubsystemProto, KeyProtocolVersion, protocolVersion)
ctx = tfsdklog.SubsystemSetField(ctx, SubsystemProto, KeyProtocolVersion, protocolVersion)

return ctx
}

// ProviderAddressContext injects the provider address into logger contexts.
func ProviderAddressContext(ctx context.Context, providerAddress string) context.Context {
ctx = tfsdklog.With(ctx, KeyProviderAddress, providerAddress)
ctx = tfsdklog.SubsystemWith(ctx, SubsystemProto, KeyProviderAddress, providerAddress)
ctx = tflog.With(ctx, KeyProviderAddress, providerAddress)
ctx = tfsdklog.SetField(ctx, KeyProviderAddress, providerAddress)
ctx = tfsdklog.SubsystemSetField(ctx, SubsystemProto, KeyProviderAddress, providerAddress)
ctx = tflog.SetField(ctx, KeyProviderAddress, providerAddress)

return ctx
}
Expand All @@ -63,27 +63,27 @@ func RequestIdContext(ctx context.Context) context.Context {
reqID = "unable to assign request ID: " + err.Error()
}

ctx = tfsdklog.With(ctx, KeyRequestID, reqID)
ctx = tfsdklog.SubsystemWith(ctx, SubsystemProto, KeyRequestID, reqID)
ctx = tflog.With(ctx, KeyRequestID, reqID)
ctx = tfsdklog.SetField(ctx, KeyRequestID, reqID)
ctx = tfsdklog.SubsystemSetField(ctx, SubsystemProto, KeyRequestID, reqID)
ctx = tflog.SetField(ctx, KeyRequestID, reqID)

return ctx
}

// ResourceContext injects the resource type into logger contexts.
func ResourceContext(ctx context.Context, resource string) context.Context {
ctx = tfsdklog.With(ctx, KeyResourceType, resource)
ctx = tfsdklog.SubsystemWith(ctx, SubsystemProto, KeyResourceType, resource)
ctx = tflog.With(ctx, KeyResourceType, resource)
ctx = tfsdklog.SetField(ctx, KeyResourceType, resource)
ctx = tfsdklog.SubsystemSetField(ctx, SubsystemProto, KeyResourceType, resource)
ctx = tflog.SetField(ctx, KeyResourceType, resource)

return ctx
}

// RpcContext injects the RPC name into logger contexts.
func RpcContext(ctx context.Context, rpc string) context.Context {
ctx = tfsdklog.With(ctx, KeyRPC, rpc)
ctx = tfsdklog.SubsystemWith(ctx, SubsystemProto, KeyRPC, rpc)
ctx = tflog.With(ctx, KeyRPC, rpc)
ctx = tfsdklog.SetField(ctx, KeyRPC, rpc)
ctx = tfsdklog.SubsystemSetField(ctx, SubsystemProto, KeyRPC, rpc)
ctx = tflog.SetField(ctx, KeyRPC, rpc)

return ctx
}

0 comments on commit 2ba77a5

Please sign in to comment.