From a8dacede246ec469ca60f5f9a5c9fcdd13b00c85 Mon Sep 17 00:00:00 2001 From: Sander van Harmelen Date: Mon, 11 May 2015 15:18:32 +0200 Subject: [PATCH] Improved some logging... MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I added a debug log line in the last commit, only to find out it’s now logging the same info twice. So removed the double entry and tweaked the existing once. --- builtin/provisioners/chef/resource_provisioner.go | 1 - communicator/ssh/communicator.go | 2 +- communicator/winrm/communicator.go | 6 +++--- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/builtin/provisioners/chef/resource_provisioner.go b/builtin/provisioners/chef/resource_provisioner.go index 6bf6d6d98..12071d6f4 100644 --- a/builtin/provisioners/chef/resource_provisioner.go +++ b/builtin/provisioners/chef/resource_provisioner.go @@ -380,7 +380,6 @@ func (p *Provisioner) runCommand( Stderr: errW, } - log.Printf("[DEBUG] Executing remote command: %q", cmd.Command) if err := comm.Start(cmd); err != nil { return fmt.Errorf("Error executing command %q: %v", cmd.Command, err) } diff --git a/communicator/ssh/communicator.go b/communicator/ssh/communicator.go index ea6aa6887..7cf03c870 100644 --- a/communicator/ssh/communicator.go +++ b/communicator/ssh/communicator.go @@ -252,7 +252,7 @@ func (c *Communicator) UploadScript(path string, input io.Reader) error { // UploadDir implementation of communicator.Communicator interface func (c *Communicator) UploadDir(dst string, src string) error { - log.Printf("Upload dir '%s' to '%s'", src, dst) + log.Printf("Uploading dir '%s' to '%s'", src, dst) scpFunc := func(w io.Writer, r *bufio.Reader) error { uploadEntries := func() error { f, err := os.Open(src) diff --git a/communicator/winrm/communicator.go b/communicator/winrm/communicator.go index ad1d1d30e..27ba31a83 100644 --- a/communicator/winrm/communicator.go +++ b/communicator/winrm/communicator.go @@ -125,8 +125,6 @@ func (c *Communicator) ScriptPath() string { // Start implementation of communicator.Communicator interface func (c *Communicator) Start(rc *remote.Cmd) error { - log.Printf("starting remote command: %s", rc.Command) - err := c.Connect(nil) if err != nil { return err @@ -137,6 +135,7 @@ func (c *Communicator) Start(rc *remote.Cmd) error { return err } + log.Printf("starting remote command: %s", rc.Command) cmd, err := shell.Execute(rc.Command) if err != nil { return err @@ -162,6 +161,7 @@ func (c *Communicator) Upload(path string, input io.Reader) error { if err != nil { return err } + log.Printf("Uploading file to '%s'", path) return wcp.Write(path, input) } @@ -172,7 +172,7 @@ func (c *Communicator) UploadScript(path string, input io.Reader) error { // UploadDir implementation of communicator.Communicator interface func (c *Communicator) UploadDir(dst string, src string) error { - log.Printf("Upload dir '%s' to '%s'", src, dst) + log.Printf("Uploading dir '%s' to '%s'", src, dst) wcp, err := c.newCopyClient() if err != nil { return err