Skip to content

Commit

Permalink
log errors in scanner and manually close logging pipe if we hit an er…
Browse files Browse the repository at this point in the history
…ror in the scanner
  • Loading branch information
SwampDragons committed Nov 11, 2019
1 parent 88530a7 commit 60cf4f6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions log.go
Expand Up @@ -43,6 +43,10 @@ func logOutput() (logOutput io.Writer, err error) {
}
os.Stderr.WriteString(fmt.Sprint(scanner.Text() + "\n"))
}
if err := scanner.Err(); err != nil {
os.Stderr.WriteString(err.Error())
w.Close()
}
}(scanner)
logOutput = w
}
Expand Down

0 comments on commit 60cf4f6

Please sign in to comment.