Skip to content

Move addFilter() call after addHandler() #184

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
Apr 19, 2022

Conversation

darrylabbate
Copy link
Contributor

CC:

This change avoids an issue where the logging.getLogger().handlers list is unconditionally subscripted with index 0, which can cause an IndexError to be thrown if no handlers were previously defined. By moving the addFilter() call after the addHandler() call, this at least guarantees handlers[0] will have been initialized first.

I've gone ahead and tested this change manually against CFN and have found no issues.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Copy link

@mrinaudo-aws mrinaudo-aws left a comment

Choose a reason for hiding this comment

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

lgtm

@darrylabbate darrylabbate merged commit 4683db8 into aws-cloudformation:master Apr 19, 2022
kddejong pushed a commit to kddejong/cloudformation-cli-python-plugin that referenced this pull request Oct 13, 2022
kddejong pushed a commit to kddejong/cloudformation-cli-python-plugin that referenced this pull request Oct 13, 2022
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.

3 participants