Delete grpclog's Debugf function
dfawley opened this issue · comments
grpc-go/internal/grpclog/prefixLogger.go
Line 65 in 9cf408e
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.