Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 6, 2025

Conversation

bt-macole
Copy link
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"

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
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
Contributor

@james03160927 james03160927 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.

@james03160927 james03160927 merged commit f58c0dc into gruntwork-io:main Feb 6, 2025
2 checks passed
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