Browse code

Windows: Fix annoying bad log

Signed-off-by: John Howard <jhoward@microsoft.com>

John Howard authored on 2015/10/14 07:03:20
Showing 1 changed files
... ...
@@ -3,6 +3,7 @@
3 3
 package windows
4 4
 
5 5
 import (
6
+	"fmt"
6 7
 	"io"
7 8
 
8 9
 	"github.com/Sirupsen/logrus"
... ...
@@ -22,7 +23,11 @@ func startStdinCopy(dst io.WriteCloser, src io.Reader) {
22 22
 	go func() {
23 23
 		defer dst.Close()
24 24
 		bytes, err := io.Copy(dst, src)
25
-		logrus.Debugf("Copied %d bytes from stdin err=%s", bytes, err)
25
+		log := fmt.Sprintf("Copied %d bytes from stdin.", bytes)
26
+		if err != nil {
27
+			log = log + " err=" + err.Error()
28
+		}
29
+		logrus.Debugf(log)
26 30
 	}()
27 31
 }
28 32
 
... ...
@@ -35,7 +40,11 @@ func startStdouterrCopy(dst io.Writer, src io.ReadCloser, name string) {
35 35
 	go func() {
36 36
 		defer src.Close()
37 37
 		bytes, err := io.Copy(dst, src)
38
-		logrus.Debugf("Copied %d bytes from %s err=%s", bytes, name, err)
38
+		log := fmt.Sprintf("Copied %d bytes from %s.", bytes, name)
39
+		if err != nil {
40
+			log = log + " err=" + err.Error()
41
+		}
42
+		logrus.Debugf(log)
39 43
 	}()
40 44
 }
41 45