Skip to content

Commit af5c120

Browse files
committed
output binary input
1 parent 816b66d commit af5c120

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

resource3/plugins/binary/call.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ func (p Plugin) call(ctx context.Context, cmd string, req interface{}, resp inte
1919
command.Dir = p.config.ResourcePlugin.Dir
2020
logger.Infof(ctx, "call %s", command.String())
2121

22-
out, err := p.execCommand(command, req)
22+
out, err := p.execCommand(ctx, command, req)
2323
if err != nil {
2424
logger.Error(ctx, err, string(out))
2525
return err
@@ -31,11 +31,13 @@ func (p Plugin) call(ctx context.Context, cmd string, req interface{}, resp inte
3131
return json.Unmarshal(out, resp)
3232
}
3333

34-
func (p Plugin) execCommand(cmd *exec.Cmd, req interface{}) ([]byte, error) {
34+
func (p Plugin) execCommand(ctx context.Context, cmd *exec.Cmd, req interface{}) ([]byte, error) {
35+
logger := log.WithFunc("resource.binary.execCommand")
3536
b, err := json.Marshal(req)
3637
if err != nil {
3738
return nil, err
3839
}
40+
logger.WithField("in", string(b)).Debug(ctx, "call params")
3941
cmd.Stdin = bytes.NewBuffer(b)
4042
return cmd.CombinedOutput()
4143
}

0 commit comments

Comments
 (0)