powertools-lambda-python icon indicating copy to clipboard operation
powertools-lambda-python copied to clipboard

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

Open heitorlessa opened this issue 9 months ago • 2 comments

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 avatar May 08 '24 16:05 heitorlessa

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

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     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar May 08 '24 16:05 codecov[bot]