fix sdNotify func when debug level

Signed-off-by: wen chen <wen.chen@daocloud.io>
This commit is contained in:
calvin0327 2022-12-11 21:44:14 +08:00 committed by calvin
parent e3ceecf92e
commit f219f7d1ea

View File

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