diff --git a/client.go b/client.go index b813ba8..8d9566e 100644 --- a/client.go +++ b/client.go @@ -199,6 +199,11 @@ type ClientConfig struct { // This isn't the output of synced stderr. Stderr io.Writer + // DisableLogStderr discards anything streamed from os.Stderr of the subprocess. + // This won't impact the synced stderr though. + // The main purpose is to reduce performance consumption when working with a wordy provider. + DisableLogStderr bool + // SyncStdout, SyncStderr can be set to override the // respective os.Std* values in the plugin. Care should be taken to // avoid races here. If these are nil, then this will be set to @@ -1178,6 +1183,10 @@ func (c *Client) logStderr(name string, r io.Reader) { return } + if c.config.DisableLogStderr { + continue + } + c.config.Stderr.Write(line) // The line was longer than our max token size, so it's likely