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

grpclog: grpc internal logging should respect log verbosity #1758

Closed
gyuho opened this issue Dec 18, 2017 · 2 comments
Closed

grpclog: grpc internal logging should respect log verbosity #1758

gyuho opened this issue Dec 18, 2017 · 2 comments

Comments

@gyuho
Copy link
Contributor

gyuho commented Dec 18, 2017

What version of gRPC are you using?

v1.7.4

What version of Go are you using (go version)?

Go 1.9.2

Problem

Balancer wrapper info logging does not respect verbosity

for addrs := range notifyCh {
grpclog.Infof("balancerWrapper: got update addr from Notify: %v\n", addrs)
if bw.pickfirst {

where you can set with

SetLogger(grpclog.NewLoggerV2WithVerbosity(os.Stderr, os.Stderr, os.Stderr, 4))

Only transport package respects verbosity, while others don't.

grpc-go/transport/log.go

Lines 28 to 32 in 2720857

func infof(format string, args ...interface{}) {
if grpclog.V(logLevel) {
grpclog.Infof(format, args...)
}
}

Could we add verbosity check to all internal logging?

ref. etcd-io/etcd#8994

@menghanl
Copy link
Contributor

The log you are referring to is a Info log. Does it work for you to ignore all the Info logs?

Or if you are only interested in Errors,
grpclog.NewLoggerV2WithVerbosity(ioutil.Discard, ioutil.Discard, os.Stderr, 0) would work.

@gyuho
Copy link
Contributor Author

gyuho commented Dec 19, 2017

@menghanl We want to see Warning/Error/Fatal, but opt out on Info (only when our --debug flag is off). So grpclog.NewLoggerV2WithVerbosity(ioutil.Discard, os.Stderr, os.Stderr, 0) would totally work.

Feel free to close this.

Thanks!

@lock lock bot locked as resolved and limited conversation to collaborators Sep 26, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants