Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

internal/logging: Add missing AdditionalLocationOffset for protocol logging #179

Merged
merged 2 commits into from Apr 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions .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
```
2 changes: 2 additions & 0 deletions internal/logging/context.go
Expand Up @@ -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...)
Expand Down