VOL-1944: Print backend name assigned only if non-nil or was assigned.
Change-Id: I3eee44fecd06cf7806778d19229a81d011ae60d9
diff --git a/afrouter/afrouter/cluster.go b/afrouter/afrouter/cluster.go
index 7fc581b..bb95183 100644
--- a/afrouter/afrouter/cluster.go
+++ b/afrouter/afrouter/cluster.go
@@ -157,7 +157,6 @@
if err := src.RecvMsg(f); err != nil {
return nil, err
}
- log.Debugf("Assigned backend %s", f.backend.name)
// Check that the backend was routable and actually has connections open.
// If it doesn't then return a nil backend to indicate this
if f.backend == nil {
@@ -169,5 +168,6 @@
log.Error(err)
return f.backend, err
}
+ log.Debugf("Assigned backend %s", f.backend.name)
return f.backend, nil
}