Skip to content

Commit

Permalink
feat: redo input/response encoding for easy parsing
Browse files Browse the repository at this point in the history
Signed-off-by: Pierre Fenoll <pierrefenoll@gmail.com>
  • Loading branch information
fenollp committed Mar 28, 2023
1 parent 40b43e7 commit 4cf0d12
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions runner/worker.go
Expand Up @@ -2,6 +2,7 @@ package runner

import (
"context"
"encoding/json"
"errors"
"fmt"
"io"
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 4cf0d12

Please sign in to comment.