Skip to content

Commit

Permalink
Revert "Better Debug logging."
Browse files Browse the repository at this point in the history
This reverts commit 0ffc2e0.
  • Loading branch information
lwoydziak committed Sep 22, 2015
1 parent c7d521b commit e78a976
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
"syscall"
"time"

bosherr "github.com/cloudfoundry/bosh-utils/errors"
boshlog "github.com/cloudfoundry/bosh-utils/logger"
bosherr "github.com/cloudfoundry/bosh-agent/internal/github.com/cloudfoundry/bosh-utils/errors"
boshlog "github.com/cloudfoundry/bosh-agent/internal/github.com/cloudfoundry/bosh-utils/logger"
)

const (
Expand Down Expand Up @@ -114,11 +114,12 @@ func (p execProcess) wait() Result {
// err will be non-nil if command exits with non-0 status
err := p.cmd.Wait()

// we log the command path with each message so the logs are coherent even when multiple commands run concurrently
stdout := string(p.stdoutWriter.Bytes())
p.logger.Debug(execProcessLogTag, "Stdout: %s", stdout)
p.logger.Debug(execProcessLogTag, "%s Stdout: %s", p.cmd.Path, stdout)

stderr := string(p.stderrWriter.Bytes())
p.logger.Debug(execProcessLogTag, "Stderr: %s", stderr)
p.logger.Debug(execProcessLogTag, "%s Stderr: %s", p.cmd.Path, stderr)

exitStatus := -1
waitStatus := p.cmd.ProcessState.Sys().(syscall.WaitStatus)
Expand All @@ -129,7 +130,7 @@ func (p execProcess) wait() Result {
exitStatus = 128 + int(waitStatus.Signal())
}

p.logger.Debug(execProcessLogTag, "Successful: %t (%d)", err == nil, exitStatus)
p.logger.Debug(execProcessLogTag, "%s Successful: %t (%d)", p.cmd.Path, err == nil, exitStatus)

if err != nil {
cmdString := strings.Join(p.cmd.Args, " ")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,13 @@ import (
"path/filepath"
"strings"

. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"github.com/stretchr/testify/assert"
. "github.com/cloudfoundry/bosh-agent/internal/github.com/onsi/ginkgo"
. "github.com/cloudfoundry/bosh-agent/internal/github.com/onsi/gomega"
"github.com/cloudfoundry/bosh-agent/internal/github.com/stretchr/testify/assert"

"io/ioutil"

boshlog "github.com/cloudfoundry/bosh-utils/logger"
boshlog "github.com/cloudfoundry/bosh-agent/internal/github.com/cloudfoundry/bosh-utils/logger"
. "github.com/cloudfoundry/bosh-agent/internal/github.com/cloudfoundry/bosh-utils/system"
"io/ioutil"
)

func createOsFs() (fs FileSystem, runner CmdRunner) {
Expand Down Expand Up @@ -99,8 +98,9 @@ func init() {
Expect(err).ToNot(HaveOccurred())
defer os.RemoveAll(testPath)

err = osFs.Chown(testPath, "garbage-foo")
err = osFs.Chown(testPath, "root")
Expect(err).To(HaveOccurred())
Expect(err.Error()).To(ContainSubstring("not permitted"))
})

It("chmod", func() {
Expand Down

0 comments on commit e78a976

Please sign in to comment.