Repository navigation
Conversation
…_to_registered_loggers
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Issue number: closes #8829
Summary
Changes
In
aws_lambda_powertools/logging/utils.py,copy_config_to_registered_loggers:{*(exclude or ()), source_logger_name, PACKAGE_LOGGER}) instead of callingexclude.update(...)on the caller's set;log_level is Noneinstead of truthiness, solog_level=0(NOTSET) is used and no longer falls back to the source logger's level.User experience
Before:
and
log_level=0set the external loggers to the source logger's level.After:
excludeis still{"mine"}, andlog_level=0sets the external loggers toNOTSET. Calls that pass nolog_level, or a non-zero one, behave as before.Verification
I used an AI assistant (Claude) to help write this change. I ran the tests below myself.
New functional tests in
tests/functional/logger/required_dependencies/test_logger_utils.py(public API only):test_copy_config_to_ext_loggers_keeps_caller_exclude_set,test_copy_config_to_ext_loggers_log_level_notset.On
develop(fix reverted, tests kept):With the fix:
Full
uv run pytest -q tests/unit tests/functionalon this branch: 4055 passed, 73 skipped, 3 failed. The same 3 fail ondevelopwithout my change, and they come from test order, not this PR: oncetests/functional/metrics/datadogis collected,ddtraceis imported and addsdd.*keys to log records, sotest_append_context_keys_handles_empty_dictandtest_log_dict_key_strip_nonessee extra keys (both pass whentests/functional/loggerruns alone). The third,test_datadog_write_to_log_with_env_variable, passes when run alone. On my machine some full runs also hung in the Redis idempotency tests ondeveloptoo, so I ran the logger tests separately as well.ruff format --checkandruff checkon the changed files: clean.mypy aws_lambda_powertools/logging/: "Success: no issues found in 17 source files".By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.