diff --git a/open_im_sdk/util.go b/open_im_sdk/util.go index 9dffa518e..498203a1a 100644 --- a/open_im_sdk/util.go +++ b/open_im_sdk/util.go @@ -361,14 +361,18 @@ func messageCall_(callback open_im_sdk_callback.SendMsgCallBack, operationID str } fnt := fnv.Type() numIn := fnt.NumIn() - fmt.Println("fn args num is", numIn, len(args)) if len(args)+1 != numIn { callback.OnError(sdkerrs.SdkInternalError, "go code error: fn in args num is not match") return } + + t := time.Now() ins := make([]reflect.Value, 0, numIn) ctx := ccontext.WithOperationID(UserForSDK.BaseCtx(), operationID) ctx = ccontext.WithSendMessageCallback(ctx, callback) + funcPtr := reflect.ValueOf(fn).Pointer() + funcName := runtime.FuncForPC(funcPtr).Name() + log.ZInfo(ctx, "input req", "function name", funcName, "args", args) ins = append(ins, reflect.ValueOf(ctx)) for i := 0; i < len(args); i++ { // callback open_im_sdk_callback.Base, operationID string, ... @@ -446,5 +450,6 @@ func messageCall_(callback open_im_sdk_callback.SendMsgCallBack, operationID str callback.OnError(sdkerrs.ArgsError, err.Error()) return } + log.ZInfo(ctx, "output resp", "function name", funcName, "resp", jsonVal, "cost time", time.Since(t)) callback.OnSuccess(string(jsonData)) }