log errors in scanner and manually close logging pipe if we hit an error in the scanner
This commit is contained in:
parent
88530a7944
commit
60cf4f6014
4
log.go
4
log.go
|
@ -43,6 +43,10 @@ func logOutput() (logOutput io.Writer, err error) {
|
||||||
}
|
}
|
||||||
os.Stderr.WriteString(fmt.Sprint(scanner.Text() + "\n"))
|
os.Stderr.WriteString(fmt.Sprint(scanner.Text() + "\n"))
|
||||||
}
|
}
|
||||||
|
if err := scanner.Err(); err != nil {
|
||||||
|
os.Stderr.WriteString(err.Error())
|
||||||
|
w.Close()
|
||||||
|
}
|
||||||
}(scanner)
|
}(scanner)
|
||||||
logOutput = w
|
logOutput = w
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue