Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The returned err should be printed #32167

Merged
merged 1 commit into from
Mar 29, 2017
Merged

Conversation

miaoyq
Copy link
Contributor

@miaoyq miaoyq commented Mar 28, 2017

Signed-off-by: Yanqiang Miao miao.yanqiang@zte.com.cn

@thaJeztah
Copy link
Member

ping @cpuguy83 looks like you added this in #22561 😄

@cpuguy83
Copy link
Member

This is fine, but maybe as a debug message.
And try with logrus.WithError(err).Debug("First discovery heartbeat failed")

@miaoyq miaoyq force-pushed the print-a-err-return branch from 0e7a157 to 87d0a3a Compare March 29, 2017 00:52
@miaoyq
Copy link
Contributor Author

miaoyq commented Mar 29, 2017

@cpuguy83
Updated

Signed-off-by: Yanqiang Miao <miao.yanqiang@zte.com.cn>
Copy link
Member

@cpuguy83 cpuguy83 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -121,6 +121,8 @@ func (d *daemonDiscoveryReloader) advertiseHeartbeat(address string) {
if err := d.initHeartbeat(address); err == nil {
ready = true
close(d.readyCh)
} else {
logrus.WithError(err).Debug("First discovery heartbeat failed")
Copy link
Contributor

@allencloud allencloud Mar 29, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shall we print the detailed error, like:

logrus.WithError(err).Debugf("First discovery heartbeat failed: %v", err)

ping @cpuguy83

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would just be the error string?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@allencloud WithError(err) will do it.

Copy link
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@vdemeester vdemeester merged commit 02faf80 into moby:master Mar 29, 2017
@GordonTheTurtle GordonTheTurtle added this to the 17.05.0 milestone Mar 29, 2017
@miaoyq miaoyq deleted the print-a-err-return branch March 29, 2017 09:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants