Skip to content
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

feat(logger-utils): preserve log level for discovered third-party top-level loggers #4299

Merged

Conversation

heitorlessa
Copy link
Contributor

Issue number: #4226

Summary

This PR introduces a new parameter to keep log levels preserved in third-party loggers that we are copying Powertools config to.

from aws_lambda_powertools import Logger
from aws_lambda_powertools.logging import utils

import requests
import boto3

powertools_logger = Logger()

utils.copy_config_to_registered_loggers(source_logger=powertools_logger, ignore_log_level=True)

Changes

Please provide a summary of what's being changed

User experience

Please share what the user experience looks like before and after this change

Checklist

If your change doesn't seem to apply, please leave them unchecked.

Is this a breaking change?

RFC issue number:

Checklist:

  • Migration process documented
  • Implement warnings (if it can live side by side)

Acknowledgment

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.

@heitorlessa heitorlessa requested a review from a team as a code owner May 8, 2024 16:55
@pull-request-size pull-request-size bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label May 8, 2024
@github-actions github-actions bot added the bug Something isn't working label May 8, 2024
Copy link

codecov bot commented May 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.32%. Comparing base (e14e768) to head (d17300a).
Report is 448 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #4299      +/-   ##
===========================================
- Coverage    96.38%   96.32%   -0.06%     
===========================================
  Files          214      218       +4     
  Lines        10030    10451     +421     
  Branches      1846     1933      +87     
===========================================
+ Hits          9667    10067     +400     
- Misses         259      270      +11     
- Partials       104      114      +10     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@boring-cyborg boring-cyborg bot added the documentation Improvements or additions to documentation label May 8, 2024
@heitorlessa heitorlessa changed the title fix(parameters): make cache aware of single vs multiple calls feat(logger-utils): preserve log level for discovered third-party top-level loggers May 8, 2024
@github-actions github-actions bot removed the documentation Improvements or additions to documentation label May 8, 2024
@boring-cyborg boring-cyborg bot added the documentation Improvements or additions to documentation label May 8, 2024
@pull-request-size pull-request-size bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels May 8, 2024
@github-actions github-actions bot added feature New feature or functionality and removed bug Something isn't working documentation Improvements or additions to documentation labels May 8, 2024
@boring-cyborg boring-cyborg bot added the documentation Improvements or additions to documentation label May 17, 2024
@github-actions github-actions bot removed the documentation Improvements or additions to documentation label May 17, 2024
Copy link

sonarcloud bot commented May 17, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
2.3% Duplication on New Code

See analysis details on SonarCloud

@leandrodamascena leandrodamascena merged commit edf556e into aws-powertools:develop May 17, 2024
17 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or functionality logger size/M Denotes a PR that changes 30-99 lines, ignoring generated files. tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants