xds: fix logging message format bug again

This commit is contained in:
ZHANG Dapeng 2019-12-17 17:16:33 -08:00 committed by GitHub
parent 52d0c994e2
commit 4733b0b123
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 10 deletions

View File

@ -83,7 +83,7 @@ public final class CdsLoadBalancer extends LoadBalancer {
@Override @Override
public void handleResolvedAddresses(ResolvedAddresses resolvedAddresses) { public void handleResolvedAddresses(ResolvedAddresses resolvedAddresses) {
channelLogger.log(ChannelLogLevel.DEBUG, "Received ResolvedAddresses '{0}'", resolvedAddresses); channelLogger.log(ChannelLogLevel.DEBUG, "Received ResolvedAddresses {0}", resolvedAddresses);
Attributes attributes = resolvedAddresses.getAttributes(); Attributes attributes = resolvedAddresses.getAttributes();
if (xdsClientRef == null) { if (xdsClientRef == null) {
xdsClientRef = resolvedAddresses.getAttributes().get(XdsAttributes.XDS_CLIENT_REF); xdsClientRef = resolvedAddresses.getAttributes().get(XdsAttributes.XDS_CLIENT_REF);
@ -133,7 +133,7 @@ public final class CdsLoadBalancer extends LoadBalancer {
@Override @Override
public void handleNameResolutionError(Status error) { public void handleNameResolutionError(Status error) {
channelLogger.log(ChannelLogLevel.ERROR, "Name resolution error: '{0}'", error); channelLogger.log(ChannelLogLevel.ERROR, "Name resolution error: {0}", error);
// Go into TRANSIENT_FAILURE if we have not yet received any cluster resource. Otherwise, // Go into TRANSIENT_FAILURE if we have not yet received any cluster resource. Otherwise,
// we keep running with the data we had previously. // we keep running with the data we had previously.
if (clusterWatcher == null) { if (clusterWatcher == null) {
@ -302,7 +302,7 @@ public final class CdsLoadBalancer extends LoadBalancer {
@Override @Override
public void onClusterChanged(ClusterUpdate newUpdate) { public void onClusterChanged(ClusterUpdate newUpdate) {
channelLogger.log( channelLogger.log(
ChannelLogLevel.DEBUG, "CDS load balancer received a cluster update: '{0}'", newUpdate); ChannelLogLevel.DEBUG, "CDS load balancer received a cluster update: {0}", newUpdate);
checkArgument( checkArgument(
newUpdate.getLbPolicy().equals("round_robin"), newUpdate.getLbPolicy().equals("round_robin"),
"The load balancing policy in ClusterUpdate '%s' is not supported", newUpdate); "The load balancing policy in ClusterUpdate '%s' is not supported", newUpdate);
@ -329,8 +329,7 @@ public final class CdsLoadBalancer extends LoadBalancer {
@Override @Override
public void onError(Status error) { public void onError(Status error) {
channelLogger.log( channelLogger.log(ChannelLogLevel.ERROR, "CDS load balancer received an error: {0}", error);
ChannelLogLevel.ERROR, "CDS load balancer received an error: '{0}'", error);
// Go into TRANSIENT_FAILURE if we have not yet created the child // Go into TRANSIENT_FAILURE if we have not yet created the child
// policy (i.e., we have not yet received valid data for the cluster). Otherwise, // policy (i.e., we have not yet received valid data for the cluster). Otherwise,

View File

@ -116,7 +116,7 @@ final class LookasideLb extends LoadBalancer {
@Override @Override
public void handleResolvedAddresses(ResolvedAddresses resolvedAddresses) { public void handleResolvedAddresses(ResolvedAddresses resolvedAddresses) {
channelLogger.log(ChannelLogLevel.DEBUG, "Received ResolvedAddresses '{0}'", resolvedAddresses); channelLogger.log(ChannelLogLevel.DEBUG, "Received ResolvedAddresses {0}", resolvedAddresses);
Attributes attributes = resolvedAddresses.getAttributes(); Attributes attributes = resolvedAddresses.getAttributes();
XdsConfig newXdsConfig; XdsConfig newXdsConfig;
@ -237,7 +237,7 @@ final class LookasideLb extends LoadBalancer {
@Override @Override
public void handleNameResolutionError(Status error) { public void handleNameResolutionError(Status error) {
channelLogger.log(ChannelLogLevel.ERROR, "Name resolution error: '{0}'", error); channelLogger.log(ChannelLogLevel.ERROR, "Name resolution error: {0}", error);
// Go into TRANSIENT_FAILURE if we have not yet received any endpoint update. Otherwise, // Go into TRANSIENT_FAILURE if we have not yet received any endpoint update. Otherwise,
// we keep running with the data we had previously. // we keep running with the data we had previously.
if (endpointWatcher == null) { if (endpointWatcher == null) {
@ -465,7 +465,7 @@ final class LookasideLb extends LoadBalancer {
public void onEndpointChanged(EndpointUpdate endpointUpdate) { public void onEndpointChanged(EndpointUpdate endpointUpdate) {
channelLogger.log( channelLogger.log(
ChannelLogLevel.DEBUG, ChannelLogLevel.DEBUG,
"EDS load balancer received an endpoint update: '{0}'", "EDS load balancer received an endpoint update: {0}",
endpointUpdate); endpointUpdate);
if (!firstEndpointUpdateReceived) { if (!firstEndpointUpdateReceived) {
@ -501,8 +501,7 @@ final class LookasideLb extends LoadBalancer {
@Override @Override
public void onError(Status error) { public void onError(Status error) {
channelLogger.log( channelLogger.log(ChannelLogLevel.ERROR, "EDS load balancer received an error: {0}", error);
ChannelLogLevel.ERROR, "EDS load balancer received an error: '{0}'", error);
endpointUpdateCallback.onError(); endpointUpdateCallback.onError();
} }
} }