Merge pull request #7798 from calvin0327/fix-sdNotify

fix sdNotify func when debug level
This commit is contained in:
Fu Wei 2022-12-12 14:36:12 +08:00 committed by GitHub
commit 5e51347a63
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -36,10 +36,13 @@ func notifyStopping(ctx context.Context) error {
func sdNotify(ctx context.Context, state string) error { func sdNotify(ctx context.Context, state string) error {
notified, err := sd.SdNotify(false, state) notified, err := sd.SdNotify(false, state)
log.G(ctx). entry := log.G(ctx)
WithError(err). if err != nil {
WithField("notified", notified). entry = entry.WithError(err)
}
entry.WithField("notified", notified).
WithField("state", state). WithField("state", state).
Debug("sd notification") Debug("sd notification")
return err return err
} }