Only send filtered stderr output to trace to avoid duplication

This commit is contained in:
Steve Streeting 2016-02-12 14:40:10 +00:00
parent 87cdc58bdf
commit 48c5cd110e

@ -663,8 +663,6 @@ func CloneWithoutFilters(args []string) error {
scanner := bufio.NewScanner(stderr) scanner := bufio.NewScanner(stderr)
for scanner.Scan() { for scanner.Scan() {
s := scanner.Text() s := scanner.Text()
// Send all stderr to trace in case useful
tracerx.Printf(s)
// Swallow all the known messages from intentionally breaking filter // Swallow all the known messages from intentionally breaking filter
if strings.Contains(s, "error: external filter") || if strings.Contains(s, "error: external filter") ||
@ -678,6 +676,8 @@ func CloneWithoutFilters(args []string) error {
strings.Contains(s, "error: cannot spawn : No such file or directory") || strings.Contains(s, "error: cannot spawn : No such file or directory") ||
// blank formatting // blank formatting
len(strings.TrimSpace(s)) == 0 { len(strings.TrimSpace(s)) == 0 {
// Send filtered stderr to trace in case useful
tracerx.Printf(s)
continue continue
} }
os.Stderr.WriteString(s) os.Stderr.WriteString(s)