Skip to content

Move addFilter() call after addHandler() - #184

Merged
darrylabbate merged 1 commit into
aws-cloudformation:masterfrom
darrylabbate:fix/indexerror
Apr 19, 2022
Merged

darrylabbate merged 1 commit into
aws-cloudformation:masterfrom
darrylabbate:fix/indexerror

Conversation

@darrylabbate

Copy link
Copy Markdown
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.

@mrinaudo-aws mrinaudo-aws left a comment

Copy link
Copy Markdown
Contributor

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