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

*: fix some log issues #6568

Merged
merged 1 commit into from
Jun 7, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions pkg/utils/etcdutil/etcdutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -531,17 +531,19 @@ func (lw *LoopWatcher) watch(ctx context.Context, revision int64) (nextRevision
if err := lw.putFn(event.Kv); err != nil {
log.Error("put failed in watch loop", zap.String("name", lw.name),
zap.String("key", lw.key), zap.Error(err))
} else {
log.Debug("put in watch loop", zap.String("name", lw.name),
zap.ByteString("key", event.Kv.Key),
zap.ByteString("value", event.Kv.Value))
}
log.Debug("put in watch loop", zap.String("name", lw.name),
zap.ByteString("key", event.Kv.Key),
zap.ByteString("value", event.Kv.Value))
case clientv3.EventTypeDelete:
if err := lw.deleteFn(event.Kv); err != nil {
log.Error("delete failed in watch loop", zap.String("name", lw.name),
zap.String("key", lw.key), zap.Error(err))
} else {
log.Debug("delete in watch loop", zap.String("name", lw.name),
zap.ByteString("key", event.Kv.Key))
}
log.Debug("delete in watch loop", zap.String("name", lw.name),
zap.ByteString("key", event.Kv.Key))
}
}
if err := lw.postEventFn(); err != nil {
Expand Down Expand Up @@ -592,7 +594,6 @@ func (lw *LoopWatcher) load(ctx context.Context) (nextRevision int64, err error)
log.Error("run post event failed in watch loop", zap.String("name", lw.name),
zap.String("key", lw.key), zap.Error(err))
}
log.Info("load finished in watch loop", zap.String("name", lw.name), zap.String("key", lw.key))
lhy1024 marked this conversation as resolved.
Show resolved Hide resolved
return resp.Header.Revision + 1, err
}
}
Expand Down