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

clientv3: Fix parsing of ETCD_CLIENT_DEBUG #14203

Merged
merged 2 commits into from
Jul 13, 2022
Merged
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 client/v3/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ func etcdClientDebugLevel() zapcore.Level {
return zapcore.InfoLevel
}
var l zapcore.Level
if err := l.Set(envLevel); err == nil {
log.Printf("Deprecated env ETCD_CLIENT_DEBUG value. Using default level: 'info'")
if err := l.Set(envLevel); err != nil {
Copy link
Member

@ahrtr ahrtr Jul 8, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change should be good. But the message below is a little confusing (see line 55). Is ETCD_CLIENT_DEBUG really deprecated? cc @serathius

Deprecated env ETCD_CLIENT_DEBUG value. Using default level: 'info'

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I parsed that sentence as the value being deprecated, rather than the setting.

#12786 introduced this code and explicitly brought back ETCD_CLIENT_DEBUG.

Copy link
Member

@ahrtr ahrtr Jul 10, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't the following message make more sense? @ptabor

Invalid value for environment variable 'ETCD_CLIENT_DEBUG'. Using default level: 'info'

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. That would be definitely better.

log.Printf("Invalid value for environment variable 'ETCD_CLIENT_DEBUG'. Using default level: 'info'")
return zapcore.InfoLevel
}
return l
Expand Down