More logging, some tweaks to the format
This commit is contained in:
parent
26a998f721
commit
286f0aa91c
|
@ -11,6 +11,8 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
log.SetFlags(log.Ldate | log.Ltime | log.Llongfile)
|
||||||
|
|
||||||
commands := map[string]string {
|
commands := map[string]string {
|
||||||
"build": "packer-build",
|
"build": "packer-build",
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,6 +38,7 @@ func CleanupClients() {
|
||||||
}()
|
}()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
log.Println("waiting for all plugin processes to complete...")
|
||||||
wg.Wait()
|
wg.Wait()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -91,6 +92,7 @@ func (c *client) Start() (address string, err error) {
|
||||||
// Start goroutine to wait for process to exit
|
// Start goroutine to wait for process to exit
|
||||||
go func() {
|
go func() {
|
||||||
c.cmd.Wait()
|
c.cmd.Wait()
|
||||||
|
log.Println("plugin process exited")
|
||||||
c.exited = true
|
c.exited = true
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
@ -159,7 +161,7 @@ func (c *client) logStderr(r io.Reader) {
|
||||||
}
|
}
|
||||||
|
|
||||||
var err error
|
var err error
|
||||||
for err == nil {
|
for err != io.EOF {
|
||||||
var line string
|
var line string
|
||||||
line, err = buf.ReadString('\n')
|
line, err = buf.ReadString('\n')
|
||||||
if line != "" {
|
if line != "" {
|
||||||
|
|
|
@ -77,6 +77,4 @@ func ServeCommand(command packer.Command) {
|
||||||
if err := serve(server); err != nil {
|
if err := serve(server); err != nil {
|
||||||
log.Panic(err)
|
log.Panic(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Println("Command successfully served. Exiting.")
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue