don't do any logging in realMain.
We should write to os.Stderr explicitly, like we already do. don't warn if config lookup fails in main
This commit is contained in:
parent
5da9b3de61
commit
0af5b4d1ad
11
main.go
11
main.go
@ -53,6 +53,9 @@ func realMain() int {
|
|||||||
logWriter = ioutil.Discard
|
logWriter = ioutil.Discard
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Disable logging here
|
||||||
|
log.SetOutput(ioutil.Discard)
|
||||||
|
|
||||||
// We always send logs to a temporary file that we use in case
|
// We always send logs to a temporary file that we use in case
|
||||||
// there is a panic. Otherwise, we delete it.
|
// there is a panic. Otherwise, we delete it.
|
||||||
logTempFile, err := ioutil.TempFile("", "packer-log")
|
logTempFile, err := ioutil.TempFile("", "packer-log")
|
||||||
@ -74,13 +77,7 @@ func realMain() int {
|
|||||||
go copyOutput(outR, doneCh)
|
go copyOutput(outR, doneCh)
|
||||||
|
|
||||||
// Enable checkpoint for panic reporting
|
// Enable checkpoint for panic reporting
|
||||||
config, err := loadConfig()
|
if config, _ := loadConfig(); config != nil && !config.DisableCheckpoint {
|
||||||
if err != nil {
|
|
||||||
fmt.Fprintf(os.Stderr, "Couldn't load config: %s", err)
|
|
||||||
return 1
|
|
||||||
}
|
|
||||||
|
|
||||||
if !config.DisableCheckpoint {
|
|
||||||
packer.CheckpointReporter.Enable(config.DisableCheckpointSignature)
|
packer.CheckpointReporter.Enable(config.DisableCheckpointSignature)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user