Skip to content

Commit c7c8aa8

Browse files
authored
xds/internal: Replace calls to Debugf with V(2) checks and Infof (#7180)
1 parent 796c615 commit c7c8aa8

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

xds/internal/balancer/priority/balancer.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,9 @@ type priorityBalancer struct {
115115
}
116116

117117
func (b *priorityBalancer) UpdateClientConnState(s balancer.ClientConnState) error {
118-
b.logger.Debugf("Received an update with balancer config: %+v", pretty.ToJSON(s.BalancerConfig))
118+
if b.logger.V(2) {
119+
b.logger.Infof("Received an update with balancer config: %+v", pretty.ToJSON(s.BalancerConfig))
120+
}
119121
newConfig, ok := s.BalancerConfig.(*LBConfig)
120122
if !ok {
121123
return fmt.Errorf("unexpected balancer config with type: %T", s.BalancerConfig)

xds/internal/xdsclient/authority.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,9 @@ func (a *authority) watchResource(rType xdsresource.Type, resourceName string, w
482482

483483
// If we have a cached copy of the resource, notify the new watcher.
484484
if state.cache != nil {
485-
a.logger.Debugf("Resource type %q with resource name %q found in cache: %s", rType.TypeName(), resourceName, state.cache.ToJSON())
485+
if a.logger.V(2) {
486+
a.logger.Infof("Resource type %q with resource name %q found in cache: %s", rType.TypeName(), resourceName, state.cache.ToJSON())
487+
}
486488
resource := state.cache
487489
a.serializer.Schedule(func(context.Context) { watcher.OnUpdate(resource) })
488490
}

xds/internal/xdsclient/bootstrap/bootstrap.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -568,6 +568,8 @@ func newConfigFromContents(data []byte) (*Config, error) {
568568
node.ClientFeatures = append(node.ClientFeatures, clientFeatureNoOverprovisioning, clientFeatureResourceWrapper)
569569
config.NodeProto = node
570570

571-
logger.Debugf("Bootstrap config for creating xds-client: %v", pretty.ToJSON(config))
571+
if logger.V(2) {
572+
logger.Infof("Bootstrap config for creating xds-client: %v", pretty.ToJSON(config))
573+
}
572574
return config, nil
573575
}

0 commit comments

Comments
 (0)