Merge pull request #3964 from mastier/master
disable log also for PACKER_LOG=0
This commit is contained in:
commit
61471f4cca
2
log.go
2
log.go
|
@ -13,7 +13,7 @@ const EnvLogFile = "PACKER_LOG_PATH" //Set to a file
|
||||||
// logOutput determines where we should send logs (if anywhere).
|
// logOutput determines where we should send logs (if anywhere).
|
||||||
func logOutput() (logOutput io.Writer, err error) {
|
func logOutput() (logOutput io.Writer, err error) {
|
||||||
logOutput = nil
|
logOutput = nil
|
||||||
if os.Getenv(EnvLog) != "" {
|
if os.Getenv(EnvLog) != "" || os.Getenv(EnvLog) != "0" {
|
||||||
logOutput = os.Stderr
|
logOutput = os.Stderr
|
||||||
|
|
||||||
if logPath := os.Getenv(EnvLogFile); logPath != "" {
|
if logPath := os.Getenv(EnvLogFile); logPath != "" {
|
||||||
|
|
|
@ -45,7 +45,7 @@ or may not appear to work correctly. In these cases, it is sometimes helpful to
|
||||||
see more details about what Packer is actually doing.
|
see more details about what Packer is actually doing.
|
||||||
|
|
||||||
Packer has detailed logs which can be enabled by setting the `PACKER_LOG`
|
Packer has detailed logs which can be enabled by setting the `PACKER_LOG`
|
||||||
environmental variable to any value like this
|
environmental variable to any value but `""` (empty string) and `"0"` like this
|
||||||
`PACKER_LOG=1 packer build <config.json>`. This will cause detailed logs to
|
`PACKER_LOG=1 packer build <config.json>`. This will cause detailed logs to
|
||||||
appear on stderr. The logs contain log messages from Packer as well as any
|
appear on stderr. The logs contain log messages from Packer as well as any
|
||||||
plugins that are being used. Log messages from plugins are prefixed by their
|
plugins that are being used. Log messages from plugins are prefixed by their
|
||||||
|
|
|
@ -15,7 +15,7 @@ each can be found below:
|
||||||
the configuration file is basic JSON. See the [core configuration
|
the configuration file is basic JSON. See the [core configuration
|
||||||
page](/docs/other/core-configuration.html).
|
page](/docs/other/core-configuration.html).
|
||||||
|
|
||||||
- `PACKER_LOG` - Setting this to any value will enable the logger. See the
|
- `PACKER_LOG` - Setting this to any value beside "" (empty string) and "0" will enable the logger. See the
|
||||||
[debugging page](/docs/other/debugging.html).
|
[debugging page](/docs/other/debugging.html).
|
||||||
|
|
||||||
- `PACKER_LOG_PATH` - The location of the log file. Note: `PACKER_LOG` must be
|
- `PACKER_LOG_PATH` - The location of the log file. Note: `PACKER_LOG` must be
|
||||||
|
|
Loading…
Reference in New Issue