fix: zap log panic

This commit is contained in:
Gordon 2023-06-15 15:13:45 +08:00
parent 230513d61b
commit 120101fdcc

View File

@ -208,7 +208,7 @@ func (l *ZapLogger) Error(ctx context.Context, msg string, err error, keysAndVal
if err != nil {
keysAndValues = append(keysAndValues, "error", err.Error())
}
keysAndValues = append([]interface{}{constant.OperationID, mcontext.GetOperationID(ctx)}, keysAndValues...)
keysAndValues = l.kvAppend(ctx, keysAndValues)
l.zap.Errorw(msg, keysAndValues...)
}