Skip to content

Commit 6b413c8

Browse files
authored
xds: Surround two Infof calls that use pretty.ToJSON with V(2) checks (#7216)
1 parent 2dbbcef commit 6b413c8

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

xds/internal/balancer/clusterimpl/clusterimpl.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,9 @@ func (b *clusterImplBalancer) UpdateClientConnState(s balancer.ClientConnState)
211211
return nil
212212
}
213213

214-
b.logger.Infof("Received update from resolver, balancer config: %+v", pretty.ToJSON(s.BalancerConfig))
214+
if b.logger.V(2) {
215+
b.logger.Infof("Received update from resolver, balancer config: %s", pretty.ToJSON(s.BalancerConfig))
216+
}
215217
newConfig, ok := s.BalancerConfig.(*LBConfig)
216218
if !ok {
217219
return fmt.Errorf("unexpected balancer config with type: %T", s.BalancerConfig)

xds/internal/balancer/clusterresolver/clusterresolver.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,9 @@ func (b *clusterResolverBalancer) updateChildConfig() {
242242
b.logger.Warningf("Failed to parse child policy config. This should never happen because the config was generated: %v", err)
243243
return
244244
}
245-
b.logger.Infof("Built child policy config: %v", pretty.ToJSON(childCfg))
245+
if b.logger.V(2) {
246+
b.logger.Infof("Built child policy config: %s", pretty.ToJSON(childCfg))
247+
}
246248

247249
endpoints := make([]resolver.Endpoint, len(addrs))
248250
for i, a := range addrs {

0 commit comments

Comments
 (0)