Ah. SetDebug is meant to tell the Packer build to run in debug-mode, which means pausing between steps. It doesn't control the debug logging. The debug logging is handled by setting or not setting PACKER_LOG=1, and the behavior is controlled and can be read in `logOutput()` in log.go.
On Thu, Aug 8, 2019 at 12:12 PM Pedro Pereira <[email protected]> wrote: > Hey list! > > So, I'm using Packer as a library for a little Go project and I'm having > trouble with controlling the output of the builds as I can't disable the > debug messages. > > What I did so far was: > > - Created a Core Config > - Created a Packer Core based on the Core Config by calling > packer.NewCore(config) > - Created a Build by calling Packer Core's .Build() function > - Called SetDebug(false) on the build generated on the step above > - Called Prepare() and then Run() > - It doesn't matter which type of UI I pass to Run() the debug > messages are still shown. > > The build process works just fine and an image is created in my GCP > account. But I keep seeing multiple debug messages even after calling > SetDebug() before calling Prepare(), as instructed by the comments in > Packer's source code. For example: > 2019/08/08 14:50:01 [DEBUG] Opening new ssh session > 2019/08/08 14:50:01 [DEBUG] Starting remote scp process: scp -vt /tmp > 2019/08/08 14:50:01 [DEBUG] Started SCP session, beginning transfers... > 2019/08/08 14:50:01 [DEBUG] Copying input data into temporary file so we > can read the length > 2019/08/08 14:50:01 [DEBUG] scp: Uploading script_7943.sh: perms=C0644 > size=61 > 2019/08/08 14:50:01 [DEBUG] SCP session complete, closing stdin pipe. > > Does anybody have any pointers? What am I missing here? > > -- > This mailing list is governed under the HashiCorp Community Guidelines - > https://www.hashicorp.com/community-guidelines.html. Behavior in > violation of those guidelines may result in your removal from this mailing > list. > > GitHub Issues: https://github.com/mitchellh/packer/issues > IRC: #packer-tool on Freenode > --- > You received this message because you are subscribed to the Google Groups > "Packer" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/packer-tool/8738736e-5aac-4ef3-89bf-48801eacfe14%40googlegroups.com > <https://groups.google.com/d/msgid/packer-tool/8738736e-5aac-4ef3-89bf-48801eacfe14%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list. GitHub Issues: https://github.com/mitchellh/packer/issues IRC: #packer-tool on Freenode --- You received this message because you are subscribed to the Google Groups "Packer" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/CAGPV1urEcFNdBMQ758PovmyEn4UXJUS%3DZcSWnuhQbjzSVZZnRw%40mail.gmail.com.
