Skip to content

copy_config_to_registered_loggers does not exclude source_logger by default #999

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

Closed
houbie opened this issue Feb 4, 2022 · 4 comments
Closed
Labels
bug Something isn't working

Comments

@houbie
Copy link
Contributor

houbie commented Feb 4, 2022

When calling copy_config_to_registered_loggers(source_logger) without explicit exclude, the source_logger is not correctly excluded.

Expected Behavior

The source_logger is excluded

Current Behavior

The source_logger name is split in letters that get all excluded

Solution

the set constructor in aws_lambda_powertools/logging/utils.py creates a set containing all the letters of the log name
exclude = set(source_logger.name)
this can be fixed with a set literal: exclude = { source_logger.name }

@houbie houbie added bug Something isn't working triage Pending triage from maintainers labels Feb 4, 2022
@heitorlessa
Copy link
Contributor

Thanks a lot for spotting this pesky bug @houbie!

Would you be able to create a quick PR fix for that? We can fast track this for the upcoming release

Cc @mploski

@mploski
Copy link
Contributor

mploski commented Feb 4, 2022

@houbie Thanks for spotting this one! I guess it would be great to write unit-test against it also to ensure we won't have regression in the future.

@heitorlessa heitorlessa removed the triage Pending triage from maintainers label Feb 4, 2022
@heitorlessa
Copy link
Contributor

Just merged and should be out early next week the latest with many other papercuts addressed - thank you so much @houbie !

Even more so being your first contribution :) 🎉

@heitorlessa heitorlessa added the pending-release Fix or implementation already in dev waiting to be released label Feb 4, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Feb 9, 2022

This is now released under 1.25.0 version!

@github-actions github-actions bot closed this as completed Feb 9, 2022
@github-actions github-actions bot removed the pending-release Fix or implementation already in dev waiting to be released label Feb 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants