diff --git a/.changelog/179.txt b/.changelog/179.txt new file mode 100644 index 000000000..1096af638 --- /dev/null +++ b/.changelog/179.txt @@ -0,0 +1,7 @@ +```release-note:bug +tfprotov5/tf5server: Ensured `@caller` in protocol logging entries accurately reflected calling code location +``` + +```release-note:bug +tfprotov6/tf6server: Ensured `@caller` in protocol logging entries accurately reflected calling code location +``` diff --git a/internal/logging/context.go b/internal/logging/context.go index 3407b4a6e..a35258a8e 100644 --- a/internal/logging/context.go +++ b/internal/logging/context.go @@ -23,6 +23,8 @@ func InitContext(ctx context.Context, sdkOpts tfsdklog.Options, providerOpts tfl tfsdklog.WithLevelFromEnv(EnvTfLogSdk), }, sdkOpts...)...) ctx = tfsdklog.NewSubsystem(ctx, SubsystemProto, append(tfsdklog.Options{ + // All calls are through the Protocol* helper functions + tfsdklog.WithAdditionalLocationOffset(1), tfsdklog.WithLevelFromEnv(EnvTfLogSdkProto), }, sdkOpts...)...) ctx = tfsdklog.NewRootProviderLogger(ctx, providerOpts...)