From bc4eba93a252f04609db3919f27e7eef344f2a4f Mon Sep 17 00:00:00 2001 From: Yoriyasu Yano <430092+yorinasub17@users.noreply.github.com> Date: Tue, 2 Feb 2021 10:45:13 -0600 Subject: [PATCH] Fix bugs from logging changes --- cli/cli_app.go | 10 ++++++---- options/options.go | 1 + 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/cli/cli_app.go b/cli/cli_app.go index d57b3a099..93573c235 100644 --- a/cli/cli_app.go +++ b/cli/cli_app.go @@ -299,7 +299,7 @@ func checkDeprecated(command string, terragruntOptions *options.TerragruntOption deprecationHandler, deprecated := deprecatedCommands[command] if deprecated { newOptions, newCommand, newCommandFriendly := deprecationHandler(terragruntOptions) - util.GlobalFallbackLogEntry.Warnf( + terragruntOptions.Logger.Warnf( "'%s' is deprecated. Running '%s' instead. Please update your workflows to use '%s', as '%s' may be removed in the future!\n", command, newCommandFriendly, @@ -352,8 +352,10 @@ func RunTerragrunt(terragruntOptions *options.TerragruntOptions) error { } if terragruntConfig.Skip { - terragruntOptions.Logger.Infof("Skipping terragrunt module %s due to skip = true.", - terragruntOptions.TerragruntConfigPath) + terragruntOptions.Logger.Infof( + "Skipping terragrunt module %s due to skip = true.", + terragruntOptions.TerragruntConfigPath, + ) return nil } @@ -917,7 +919,7 @@ func runAll(terragruntOptions *options.TerragruntOptions) error { return err } - terragruntOptions.Logger.Printf("%s", stack.String()) + terragruntOptions.Logger.Infof("%s", stack.String()) var prompt string switch terragruntOptions.TerraformCommand { diff --git a/options/options.go b/options/options.go index 082ccb331..d9031ce98 100644 --- a/options/options.go +++ b/options/options.go @@ -256,6 +256,7 @@ func (terragruntOptions *TerragruntOptions) Clone(terragruntConfigPath string) * TerraformCliArgs: util.CloneStringList(terragruntOptions.TerraformCliArgs), WorkingDir: workingDir, Logger: util.CreateLogEntryWithWriter(terragruntOptions.ErrWriter, workingDir, terragruntOptions.LogLevel), + LogLevel: terragruntOptions.LogLevel, Env: util.CloneStringMap(terragruntOptions.Env), Source: terragruntOptions.Source, SourceUpdate: terragruntOptions.SourceUpdate,