[skip ci]Add comment for MarshalLogObject (#9920)

Signed-off-by: sunby <bingyi.sun@zilliz.com>
pull/9684/head
sunby 2021-10-14 21:26:33 +08:00 committed by GitHub
parent 3a6f6d399f
commit 003a7ed7cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -295,6 +295,7 @@ func parseNodeID(key string) (int64, error) {
// ChannelOpTypeNames implements zap log marshaler for ChannelOpSet // ChannelOpTypeNames implements zap log marshaler for ChannelOpSet
var ChannelOpTypeNames = []string{"Add", "Delete"} var ChannelOpTypeNames = []string{"Add", "Delete"}
// MarshalLogObject implements the interface ObjectMarshaler
func (cu *ChannelOp) MarshalLogObject(enc zapcore.ObjectEncoder) error { func (cu *ChannelOp) MarshalLogObject(enc zapcore.ObjectEncoder) error {
enc.AddString("type", ChannelOpTypeNames[cu.Type]) enc.AddString("type", ChannelOpTypeNames[cu.Type])
enc.AddInt64("nodeID", cu.NodeID) enc.AddInt64("nodeID", cu.NodeID)