Skip to content

Commit 2ba77a5

Browse files
Bump github.com/hashicorp/terraform-plugin-log from 0.4.1 to 0.6.0 (#209)
* 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] <[email protected]> * 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 <[email protected]>
1 parent a6fc6ab commit 2ba77a5

File tree

4 files changed

+22
-19
lines changed

4 files changed

+22
-19
lines changed

.changelog/209.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:note
2+
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.
3+
```

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ require (
77
github.com/hashicorp/go-hclog v1.2.1
88
github.com/hashicorp/go-plugin v1.4.4
99
github.com/hashicorp/go-uuid v1.0.3
10-
github.com/hashicorp/terraform-plugin-log v0.4.1
10+
github.com/hashicorp/terraform-plugin-log v0.6.0
1111
github.com/hashicorp/terraform-registry-address v0.0.0-20220623143253-7d51757b572c
1212
github.com/mitchellh/go-testing-interface v1.14.1
1313
github.com/nsf/jsondiff v0.0.0-20200515183724-f29ed568f4ce

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ github.com/hashicorp/go-plugin v1.4.4/go.mod h1:viDMjcLJuDui6pXb8U4HVfb8AamCWhHG
6464
github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8=
6565
github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
6666
github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
67-
github.com/hashicorp/terraform-plugin-log v0.4.1 h1:xpbmVhvuU3mgHzLetOmx9pkOL2rmgpu302XxddON6eo=
68-
github.com/hashicorp/terraform-plugin-log v0.4.1/go.mod h1:p4R1jWBXRTvL4odmEkFfDdhUjHf9zcs/BCoNHAc7IK4=
67+
github.com/hashicorp/terraform-plugin-log v0.6.0 h1:/Vq78uSIdUSZ3iqDc9PESKtwt8YqNKN6u+khD+lLjuw=
68+
github.com/hashicorp/terraform-plugin-log v0.6.0/go.mod h1:p4R1jWBXRTvL4odmEkFfDdhUjHf9zcs/BCoNHAc7IK4=
6969
github.com/hashicorp/terraform-registry-address v0.0.0-20220623143253-7d51757b572c h1:D8aRO6+mTqHfLsK/BC3j5OAoogv1WLRWzY1AaTo3rBg=
7070
github.com/hashicorp/terraform-registry-address v0.0.0-20220623143253-7d51757b572c/go.mod h1:Wn3Na71knbXc1G8Lh+yu/dQWWJeFQEpDeJMtWMtlmNI=
7171
github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734 h1:HKLsbzeOsfXmKNpr3GiT18XAblV0BjCbzL8KQAMZGa0=

internal/logging/context.go

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ import (
1010

1111
// DataSourceContext injects the data source type into logger contexts.
1212
func DataSourceContext(ctx context.Context, dataSource string) context.Context {
13-
ctx = tfsdklog.With(ctx, KeyDataSourceType, dataSource)
14-
ctx = tfsdklog.SubsystemWith(ctx, SubsystemProto, KeyDataSourceType, dataSource)
15-
ctx = tflog.With(ctx, KeyDataSourceType, dataSource)
13+
ctx = tfsdklog.SetField(ctx, KeyDataSourceType, dataSource)
14+
ctx = tfsdklog.SubsystemSetField(ctx, SubsystemProto, KeyDataSourceType, dataSource)
15+
ctx = tflog.SetField(ctx, KeyDataSourceType, dataSource)
1616

1717
return ctx
1818
}
@@ -41,16 +41,16 @@ func ProtoSubsystemContext(ctx context.Context, sdkOpts tfsdklog.Options) contex
4141

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

4646
return ctx
4747
}
4848

4949
// ProviderAddressContext injects the provider address into logger contexts.
5050
func ProviderAddressContext(ctx context.Context, providerAddress string) context.Context {
51-
ctx = tfsdklog.With(ctx, KeyProviderAddress, providerAddress)
52-
ctx = tfsdklog.SubsystemWith(ctx, SubsystemProto, KeyProviderAddress, providerAddress)
53-
ctx = tflog.With(ctx, KeyProviderAddress, providerAddress)
51+
ctx = tfsdklog.SetField(ctx, KeyProviderAddress, providerAddress)
52+
ctx = tfsdklog.SubsystemSetField(ctx, SubsystemProto, KeyProviderAddress, providerAddress)
53+
ctx = tflog.SetField(ctx, KeyProviderAddress, providerAddress)
5454

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

66-
ctx = tfsdklog.With(ctx, KeyRequestID, reqID)
67-
ctx = tfsdklog.SubsystemWith(ctx, SubsystemProto, KeyRequestID, reqID)
68-
ctx = tflog.With(ctx, KeyRequestID, reqID)
66+
ctx = tfsdklog.SetField(ctx, KeyRequestID, reqID)
67+
ctx = tfsdklog.SubsystemSetField(ctx, SubsystemProto, KeyRequestID, reqID)
68+
ctx = tflog.SetField(ctx, KeyRequestID, reqID)
6969

7070
return ctx
7171
}
7272

7373
// ResourceContext injects the resource type into logger contexts.
7474
func ResourceContext(ctx context.Context, resource string) context.Context {
75-
ctx = tfsdklog.With(ctx, KeyResourceType, resource)
76-
ctx = tfsdklog.SubsystemWith(ctx, SubsystemProto, KeyResourceType, resource)
77-
ctx = tflog.With(ctx, KeyResourceType, resource)
75+
ctx = tfsdklog.SetField(ctx, KeyResourceType, resource)
76+
ctx = tfsdklog.SubsystemSetField(ctx, SubsystemProto, KeyResourceType, resource)
77+
ctx = tflog.SetField(ctx, KeyResourceType, resource)
7878

7979
return ctx
8080
}
8181

8282
// RpcContext injects the RPC name into logger contexts.
8383
func RpcContext(ctx context.Context, rpc string) context.Context {
84-
ctx = tfsdklog.With(ctx, KeyRPC, rpc)
85-
ctx = tfsdklog.SubsystemWith(ctx, SubsystemProto, KeyRPC, rpc)
86-
ctx = tflog.With(ctx, KeyRPC, rpc)
84+
ctx = tfsdklog.SetField(ctx, KeyRPC, rpc)
85+
ctx = tfsdklog.SubsystemSetField(ctx, SubsystemProto, KeyRPC, rpc)
86+
ctx = tflog.SetField(ctx, KeyRPC, rpc)
8787

8888
return ctx
8989
}

0 commit comments

Comments
 (0)