grpc-go
grpc-go copied to clipboard
Delete grpclog's Debugf function
https://github.com/grpc/grpc-go/blob/9cf408ec48fe2b20d020b2430981a148fd93d187/internal/grpclog/prefixLogger.go#L65
If a parameter passed to these functions is expensive to evaluate, that expense is borne regardless of whether verbosity would output the message .
All usages should be audited, and we should write another function that allows the arguments to be processed lazily (i.e. pass in closures).
write another function that allows the arguments to be processed lazily (i.e. pass in closures).
Upon further consideration, I don't think this was a good suggestion.
The alternative would be to eliminate prefixlogger Debugf method (which is internal) method and favor Infof gated by if logger.V(2) {}, like we do in most places. The problem is that PrefixLogger doesn't have a V method, and neither has its DepthLogger member.
Yes, that's what I was thinking, too. We could add this method -- worst case, the PrefixLogger can expose it and just call the global logger like it's doing today.
@dfawley Hi, is it possible for me to contribute to this?
@waganaha66 Feel free to send a PR or let us know if you have questions. Thanks!