From 4cf0d12ff36f2f92301474c5e9f6dba6740a694b Mon Sep 17 00:00:00 2001 From: Pierre Fenoll Date: Tue, 28 Mar 2023 13:10:13 +0200 Subject: [PATCH] feat: redo input/response encoding for easy parsing Signed-off-by: Pierre Fenoll --- runner/worker.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/runner/worker.go b/runner/worker.go index 6198b4df..58ee2bb1 100644 --- a/runner/worker.go +++ b/runner/worker.go @@ -2,6 +2,7 @@ package runner import ( "context" + "encoding/json" "errors" "fmt" "io" @@ -177,10 +178,13 @@ func (w *Worker) makeUnaryRequest(ctx *context.Context, reqMD *metadata.MD, inpu res, resErr = w.stub.InvokeRpc(*ctx, w.mtd, input, callOptions...) if w.config.hasLog { + inputData, _ := input.MarshalJSON() + resData, _ := json.Marshal(res) + w.config.log.Debugw("Received response", "workerID", w.workerID, "call type", "unary", "call", w.mtd.GetFullyQualifiedName(), - "input", input, "metadata", reqMD, - "response", res, "error", resErr) + "input", string(inputData), "metadata", reqMD, + "response", string(resData), "error", resErr) } return resErr