diff --git a/.changelog/179.txt b/.changelog/179.txt new file mode 100644 index 00000000..1096af63 --- /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 3407b4a6..a35258a8 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...)