From c7c8aa8f53e4e4a4cd5ae49e57ab421a253fa7f3 Mon Sep 17 00:00:00 2001 From: Brad Town Date: Thu, 2 May 2024 16:45:39 -0700 Subject: [PATCH] xds/internal: Replace calls to `Debugf` with `V(2)` checks and `Infof` (#7180) --- xds/internal/balancer/priority/balancer.go | 4 +++- xds/internal/xdsclient/authority.go | 4 +++- xds/internal/xdsclient/bootstrap/bootstrap.go | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/xds/internal/balancer/priority/balancer.go b/xds/internal/balancer/priority/balancer.go index 7efbe402a8e5..988ca280789e 100644 --- a/xds/internal/balancer/priority/balancer.go +++ b/xds/internal/balancer/priority/balancer.go @@ -115,7 +115,9 @@ type priorityBalancer struct { } func (b *priorityBalancer) UpdateClientConnState(s balancer.ClientConnState) error { - b.logger.Debugf("Received an update with balancer config: %+v", pretty.ToJSON(s.BalancerConfig)) + if b.logger.V(2) { + b.logger.Infof("Received an update with balancer config: %+v", pretty.ToJSON(s.BalancerConfig)) + } newConfig, ok := s.BalancerConfig.(*LBConfig) if !ok { return fmt.Errorf("unexpected balancer config with type: %T", s.BalancerConfig) diff --git a/xds/internal/xdsclient/authority.go b/xds/internal/xdsclient/authority.go index 285c20070665..e76ce555b780 100644 --- a/xds/internal/xdsclient/authority.go +++ b/xds/internal/xdsclient/authority.go @@ -482,7 +482,9 @@ func (a *authority) watchResource(rType xdsresource.Type, resourceName string, w // If we have a cached copy of the resource, notify the new watcher. if state.cache != nil { - a.logger.Debugf("Resource type %q with resource name %q found in cache: %s", rType.TypeName(), resourceName, state.cache.ToJSON()) + if a.logger.V(2) { + a.logger.Infof("Resource type %q with resource name %q found in cache: %s", rType.TypeName(), resourceName, state.cache.ToJSON()) + } resource := state.cache a.serializer.Schedule(func(context.Context) { watcher.OnUpdate(resource) }) } diff --git a/xds/internal/xdsclient/bootstrap/bootstrap.go b/xds/internal/xdsclient/bootstrap/bootstrap.go index e27930357cfe..1e0bbfa68b61 100644 --- a/xds/internal/xdsclient/bootstrap/bootstrap.go +++ b/xds/internal/xdsclient/bootstrap/bootstrap.go @@ -568,6 +568,8 @@ func newConfigFromContents(data []byte) (*Config, error) { node.ClientFeatures = append(node.ClientFeatures, clientFeatureNoOverprovisioning, clientFeatureResourceWrapper) config.NodeProto = node - logger.Debugf("Bootstrap config for creating xds-client: %v", pretty.ToJSON(config)) + if logger.V(2) { + logger.Infof("Bootstrap config for creating xds-client: %v", pretty.ToJSON(config)) + } return config, nil }