-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Log stack traces only in debug mode #12989
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
base: main
Are you sure you want to change the base?
Conversation
Test Results (amd64) - Integration, Bootstrap 5 files 5 suites 2h 21m 9s ⏱️ Results for commit 85890e1. ♻️ This comment has been updated with latest results. |
LOG.exception( | ||
"Could not validate the notification destination %s", | ||
target_arn, | ||
exc_info=LOG.isEnabledFor(logging.DEBUG), | ||
) |
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.
nit: this stayed LOG.exception
This is very nice, would it be possible to do the following so that we still get why it failed? Sorry it's on me, the current exception logging wasn't that great for this one:
except ClientError as e:
code = response["Error"]["Code"]
LOG.error(
"Could not validate the notification destination %s: %s",
target_arn,
code,
exc_info=LOG.isEnabledFor(logging.DEBUG),
)
So that the user would still get an indication as to why it failed, as this is a Boto error, we can provider at least the name of the exception like "AccessDenied" for example.
I had started reviewing the rest but saw you put back on draft 👍 will do the rest later
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.
Super sorry for the early ping 🙏 There are more incoming changes. Sure 💯 I will fix this one 👍
Motivation
As a part of the initiative for improving Localstack error messages and stack traces, this PR aims to ensure that stack traces are logged when debug mode is enabled. Currently, in some use cases stack traces are logged without checking if debug mode is enabled or not. This causes excessive log noise even when
DEBUG=0
.Changes
This PR cleans up logging across different use cases to ensure that stack traces are only logged when debug mode is enabled.