diff --git a/command/build.go b/command/build.go index ecbccc35b..794c5a775 100644 --- a/command/build.go +++ b/command/build.go @@ -309,7 +309,7 @@ Options: -machine-readable Machine-readable output -on-error=[cleanup|abort|ask] If the build fails do: clean up (default), abort, or ask -parallel=false Disable parallelization (on by default) - -timestamp=true Enable timestamps in build log (off by default) + -timestamp-ui=true Prefix each ui output with an RFC3339 timestamp (off by default). -var 'key=value' Variable for templates, can be used multiple times. -var-file=path JSON file containing user variables. ` diff --git a/packer/ui.go b/packer/ui.go index 9e46d46b8..2a0f5e275 100644 --- a/packer/ui.go +++ b/packer/ui.go @@ -99,14 +99,6 @@ type MachineReadableUi struct { var _ Ui = new(MachineReadableUi) -// TimestampedUi is a UI that wraps another UI implementation and prefixes -// prefixes each message with an RFC3339 timestamp -type TimestampedUi struct { - Ui Ui -} - -var _ Ui = new(TimestampedUi) - func (u *ColoredUi) Ask(query string) (string, error) { return u.Ui.Ask(u.colorize(query, u.Color, true)) } @@ -351,6 +343,14 @@ func (u *MachineReadableUi) ProgressBar() ProgressBar { return new(NoopProgressBar) } +// TimestampedUi is a UI that wraps another UI implementation and prefixes +// prefixes each message with an RFC3339 timestamp +type TimestampedUi struct { + Ui Ui +} + +var _ Ui = new(TimestampedUi) + func (u *TimestampedUi) Ask(query string) (string, error) { return u.Ui.Ask(query) } diff --git a/website/source/docs/commands/build.html.md b/website/source/docs/commands/build.html.md index 433419390..1c44df43c 100644 --- a/website/source/docs/commands/build.html.md +++ b/website/source/docs/commands/build.html.md @@ -50,8 +50,8 @@ that are created will be outputted at the end of the build. - `-parallel=false` - Disable parallelization of multiple builders (on by default). -- `-timestamp=true` - Enable timestamps for build logs without adding the extra - information included if PACKER_LOG is true. +- `-timestamp-ui=true` - Prefix each ui output with an RFC3339 timestamp (off + by default). - `-var` - Set a variable in your packer template. This option can be used multiple times. This is useful for setting version numbers for your build.