Skip to content

Commit

Permalink
don't do any logging in realMain.
Browse files Browse the repository at this point in the history
We should write to os.Stderr explicitly, like we already do.

don't warn if config lookup fails in main
  • Loading branch information
mwhooker committed Jun 21, 2017
1 parent 5da9b3d commit 0af5b4d
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ func realMain() int {
logWriter = ioutil.Discard
}

// Disable logging here
log.SetOutput(ioutil.Discard)

// We always send logs to a temporary file that we use in case
// there is a panic. Otherwise, we delete it.
logTempFile, err := ioutil.TempFile("", "packer-log")
Expand All @@ -74,13 +77,7 @@ func realMain() int {
go copyOutput(outR, doneCh)

// Enable checkpoint for panic reporting
config, err := loadConfig()
if err != nil {
fmt.Fprintf(os.Stderr, "Couldn't load config: %s", err)
return 1
}

if !config.DisableCheckpoint {
if config, _ := loadConfig(); config != nil && !config.DisableCheckpoint {
packer.CheckpointReporter.Enable(config.DisableCheckpointSignature)
}

Expand Down

0 comments on commit 0af5b4d

Please sign in to comment.