@@ -19,7 +19,7 @@ func (p Plugin) call(ctx context.Context, cmd string, req interface{}, resp inte
19
19
command .Dir = p .config .ResourcePlugin .Dir
20
20
logger .Infof (ctx , "call %s" , command .String ())
21
21
22
- out , err := p .execCommand (command , req )
22
+ out , err := p .execCommand (ctx , command , req )
23
23
if err != nil {
24
24
logger .Error (ctx , err , string (out ))
25
25
return err
@@ -31,11 +31,13 @@ func (p Plugin) call(ctx context.Context, cmd string, req interface{}, resp inte
31
31
return json .Unmarshal (out , resp )
32
32
}
33
33
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" )
35
36
b , err := json .Marshal (req )
36
37
if err != nil {
37
38
return nil , err
38
39
}
40
+ logger .WithField ("in" , string (b )).Debug (ctx , "call params" )
39
41
cmd .Stdin = bytes .NewBuffer (b )
40
42
return cmd .CombinedOutput ()
41
43
}
0 commit comments