mirror of
https://github.com/hashicorp/packer.git
synced 2026-04-22 14:47:19 -04:00
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
1 changed files with 4 additions and 0 deletions
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"))
|
||||
}
|
||||
if err := scanner.Err(); err != nil {
|
||||
os.Stderr.WriteString(err.Error())
|
||||
w.Close()
|
||||
}
|
||||
}(scanner)
|
||||
logOutput = w
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue