Skip to content

fix(cmd): support custom TG logger settings#1509

Merged
james00012 merged 1 commit intogruntwork-io:mainfrom
bt-macole:tgLogFormattingConfig
Feb 6, 2025
Merged

fix(cmd): support custom TG logger settings#1509
james00012 merged 1 commit intogruntwork-io:mainfrom
bt-macole:tgLogFormattingConfig

Conversation

@bt-macole
Copy link
Copy Markdown
Contributor

Terragrunt log formatting was only supported within the options.envVars. If settings were defined at the OS env level, they were ignored.

This will now check options.envVar and then os.env vars before using the default settings for TG log formatting in terratest.

Fixes: #1508

  • Run the relevant tests successfully, including pre-commit checks.
  • Ensure any 3rd party code adheres with our license policy or delete this line if its not applicable.
  • Include release notes. If this PR is backward incompatible, include a migration guide.

Release Notes (draft)

Updated Terragrunt log formatting configuration

@bt-macole bt-macole requested a review from denis256 as a code owner February 4, 2025 22:55
if !inEnv {
// key-value format for terragrunt logs to avoid colors and have plain form
// https://terragrunt.gruntwork.io/docs/reference/cli-options/#terragrunt-log-format
options.EnvVars[tgLogFormatKey] = "key-value"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The documented default is 'pretty'

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

key-value format for terragrunt logs to avoid colors and have plain form by default inside terratest

Terragrunt log formatting was only supported within the options.envVars.
If settings were defined at the OS env level, they were ignored.

This will now check options.envVar and then os.env vars before using the
default settings for TG log formatting in terratest.

resolves: gruntwork-io#1508
@bt-macole bt-macole force-pushed the tgLogFormattingConfig branch from bdb44d7 to f927880 Compare February 6, 2025 15:38
Copy link
Copy Markdown
Contributor

@james00012 james00012 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Pass all the relevant tests.

@james00012 james00012 merged commit f58c0dc into gruntwork-io:main Feb 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Terragrunt log formatting env vars are ignored when set at OS level

3 participants