@@ -13,7 +13,11 @@ import (
13
13
// already have the root SDK logger and root provider logger setup from
14
14
// terraform-plugin-go tf5server RPC handlers.
15
15
func InitContext (ctx context.Context ) context.Context {
16
- ctx = tfsdklog .NewSubsystem (ctx , SubsystemHelperSchema , tfsdklog .WithLevelFromEnv (EnvTfLogSdkHelperSchema ))
16
+ ctx = tfsdklog .NewSubsystem (ctx , SubsystemHelperSchema , tfsdklog.Options {
17
+ // All calls are through the HelperSchema* helper functions
18
+ tfsdklog .WithAdditionalLocationOffset (1 ),
19
+ tfsdklog .WithLevelFromEnv (EnvTfLogSdkHelperSchema ),
20
+ }... )
17
21
18
22
return ctx
19
23
}
@@ -30,7 +34,11 @@ func InitTestContext(ctx context.Context, t testing.T) context.Context {
30
34
31
35
ctx = tfsdklog .RegisterTestSink (ctx , t )
32
36
ctx = tfsdklog .NewRootSDKLogger (ctx , tfsdklog .WithLevelFromEnv (EnvTfLogSdk ))
33
- ctx = tfsdklog .NewSubsystem (ctx , SubsystemHelperResource , tfsdklog .WithLevelFromEnv (EnvTfLogSdkHelperResource ))
37
+ ctx = tfsdklog .NewSubsystem (ctx , SubsystemHelperResource , tfsdklog.Options {
38
+ // All calls are through the HelperResource* helper functions
39
+ tfsdklog .WithAdditionalLocationOffset (1 ),
40
+ tfsdklog .WithLevelFromEnv (EnvTfLogSdkHelperResource ),
41
+ }... )
34
42
ctx = TestNameContext (ctx , t .Name ())
35
43
36
44
return ctx
0 commit comments