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

Update warning about unkown key to use the caller location #34845

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pkg/config/viperconfig/viper.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,8 @@ func (c *safeConfig) checkKnownKey(key string) {
c.unknownKeys[key] = struct{}{}
c.Unlock()

// log without holding the lock
log.Warnf("config key %v is unknown", key)
// log without holding the lock. We use stack depth +3 to use the caller function location instead of checkKnownKey
log.WarnfStackDepth(3, "config key '%v' is unknown", key)
}

// GetKnownKeysLowercased returns all the keys that meet at least one of these criteria:
Expand Down