More logging, some tweaks to the format

This commit is contained in:
Mitchell Hashimoto 2013-05-08 12:43:41 -07:00
parent 26a998f721
commit 286f0aa91c
3 changed files with 5 additions and 3 deletions

View File

@ -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",
} }

View File

@ -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 != "" {

View File

@ -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.")
} }