Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
apiclient: don't log at error level when dialing #6830
Conversation
| return conn, nil | ||
| } | ||
| - if isX509Error(err) { | ||
| + if certErr := isX509Error(err); !a.HasNext() || certErr { |
jameinel
Jan 18, 2017
Owner
isCertErr would be a clearer variable name to not make you think that this was an error object, but is a boolean.
| - } | ||
| - if !a.HasNext() { | ||
| - logger.Errorf("error dialing %q: %v", cfg.Location, err) | ||
| + logger.Debugf("error dialing %q (certificate error %v): %v", certErr, err) |
jameinel
Jan 18, 2017
Owner
what do you think about:
detail := ""
if isCertErr {
detail = " (bad certificate)"
}
logger.Debugf("error dialing %q%s: %v", cfg.Location, detail, err)
|
$$merge$$ |
|
Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju |
jujubot
merged commit 0abde22
into
juju:develop
Jan 18, 2017
1 check passed
github-check-merge-juju
Built PR, ran unit tests, and tested LXD deploy. Use !!.*!! to request another build. IE, !!build!!, !!retry!!
Details
rogpeppe
referenced this pull request
Feb 6, 2017
Merged
apiclient: don't log at error level when dialing #6926
added a commit
that referenced
this pull request
Feb 6, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
rogpeppe commentedJan 18, 2017
PR #6620 changed the client logging so that it logs an
error when it can't connect to an API address.
It is common for these errors to occur when connecting
even though the actual connect succeeds, so this
PR changes the logging to debug level - it's part
of the implementation but not something that users
should always see.