xds: Surround two `Infof` calls that use `pretty.ToJSON` with `V(2)` checks (#7216)

This commit is contained in:
Brad Town 2024-05-09 12:44:18 -07:00 committed by GitHub
parent 2dbbcefef2
commit 6b413c8351
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 2 deletions

View File

@ -211,7 +211,9 @@ func (b *clusterImplBalancer) UpdateClientConnState(s balancer.ClientConnState)
return nil
}
b.logger.Infof("Received update from resolver, balancer config: %+v", pretty.ToJSON(s.BalancerConfig))
if b.logger.V(2) {
b.logger.Infof("Received update from resolver, balancer config: %s", pretty.ToJSON(s.BalancerConfig))
}
newConfig, ok := s.BalancerConfig.(*LBConfig)
if !ok {
return fmt.Errorf("unexpected balancer config with type: %T", s.BalancerConfig)

View File

@ -242,7 +242,9 @@ func (b *clusterResolverBalancer) updateChildConfig() {
b.logger.Warningf("Failed to parse child policy config. This should never happen because the config was generated: %v", err)
return
}
b.logger.Infof("Built child policy config: %v", pretty.ToJSON(childCfg))
if b.logger.V(2) {
b.logger.Infof("Built child policy config: %s", pretty.ToJSON(childCfg))
}
endpoints := make([]resolver.Endpoint, len(addrs))
for i, a := range addrs {