-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
#1887 Reduced log level for misleading error logs #1889
Conversation
configstack/module.go
Outdated
cfgOptions.LogLevel = terragruntOptions.LogLevel | ||
if terragruntOptions.TerraformCommand == "destroy" { | ||
var hook = NewLogReductionHook() | ||
hook.AddMessage("Encountered error while evaluating locals", logrus.DebugLevel) | ||
cfgOptions.Logger.Logger.AddHook(hook) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the desired behavior is to push all messages while parsing for finding stack to debug level, not just this message. E.g., the Error: Error in function call
logs are also noise. Basically, the only log we want is the warning log (WARN: Failed to detect ...
).
So maybe the hook we need is ForceLogLevelHook
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To handle entries like Error: Error in function call
had to update DiagnosticTextWriter
to write output through logger
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updates LGTM! Let me kick off a build now. I'll also do some tests to see what the new outputs look like and if they all look good, we can merge this in!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confirmed the logs look and behave as desired! Once the build passes, I think we can merge this in!
Build passed, so will go ahead and merge this in! Thanks! |
Reduced log level for misleading error logs
Before:
After:
Bugfix for: #1887