diff options
| author | Taras Madan <tarasmadan@google.com> | 2022-10-24 12:11:23 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-10-24 10:11:23 +0000 |
| commit | e9faea6a6321e7260c169705d133b4a26a3f0f5b (patch) | |
| tree | d517955ff14050cb2757bcba17980b03bb1d388e | |
| parent | faae2fdada12b98e508bcf76fef1fe1aa5f5183b (diff) | |
vm/proxyapp: configure proxyApp log output (#3459)
| -rw-r--r-- | vm/proxyapp/init.go | 3 | ||||
| -rw-r--r-- | vm/proxyapp/proxyappclient.go | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/vm/proxyapp/init.go b/vm/proxyapp/init.go index 17db527f9..538cadf6f 100644 --- a/vm/proxyapp/init.go +++ b/vm/proxyapp/init.go @@ -8,6 +8,7 @@ import ( "encoding/json" "fmt" "io" + "os" "time" "github.com/google/syzkaller/pkg/config" @@ -19,6 +20,7 @@ func makeDefaultParams() *proxyAppParams { return &proxyAppParams{ CommandRunner: osutilCommandContext, InitRetryDelay: 10 * time.Second, + LogOutput: os.Stdout, } } @@ -35,6 +37,7 @@ func init() { type proxyAppParams struct { CommandRunner func(context.Context, string, ...string) subProcessCmd InitRetryDelay time.Duration + LogOutput io.Writer } func osutilCommandContext(ctx context.Context, bin string, args ...string) subProcessCmd { diff --git a/vm/proxyapp/proxyappclient.go b/vm/proxyapp/proxyappclient.go index d51039456..b17e045d0 100644 --- a/vm/proxyapp/proxyappclient.go +++ b/vm/proxyapp/proxyappclient.go @@ -11,7 +11,6 @@ import ( "io" "net/rpc" "net/rpc/jsonrpc" - "os" "sync" "time" @@ -172,7 +171,7 @@ func runProxyApp(params *proxyAppParams, cmd string) (*ProxyApp, error) { onTerminated := make(chan bool, 1) go func() { - io.Copy(os.Stdout, subprocessLogs) + io.Copy(params.LogOutput, subprocessLogs) if err := subProcess.Wait(); err != nil { log.Logf(0, "failed to Wait() subprocess: %v", err) } |
