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): clone powertools logger config to any Python logger #927

Merged
merged 7 commits into from
Jan 5, 2022

Conversation

mploski
Copy link
Contributor

@mploski mploski commented Dec 23, 2021

**Issue #, if available: aws-powertools/powertools-lambda#40

Description of changes:

This feature allows customers to clone Powertools Logger configuration like level & handler to any registered Python loggers - exclusion, inclusion-only are also supported.

Breaking change checklist

RFC issue #:

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

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

@pull-request-size pull-request-size bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Dec 23, 2021
@mploski mploski marked this pull request as draft December 23, 2021 23:19
@mploski mploski changed the title feat(logger): enable powertools logging for imported libraries (#40) feat(logger): enable powertools logging for imported libraries Dec 23, 2021
Copy link
Contributor

@heitorlessa heitorlessa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

quick initial review as it's missing the log level parameter.

They should be able to override log level when copying the config over

aws_lambda_powertools/logging/utils.py Outdated Show resolved Hide resolved
aws_lambda_powertools/logging/utils.py Outdated Show resolved Hide resolved
@mploski mploski force-pushed the feat/unified-logging branch from 973b8f2 to bc29018 Compare December 24, 2021 09:44
@codecov-commenter
Copy link

codecov-commenter commented Dec 24, 2021

Codecov Report

Merging #927 (36420a2) into develop (321f493) will increase coverage by 0.07%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #927      +/-   ##
===========================================
+ Coverage    99.88%   99.96%   +0.07%     
===========================================
  Files          118      119       +1     
  Lines         5272     5322      +50     
  Branches       605      614       +9     
===========================================
+ Hits          5266     5320      +54     
+ Misses           2        0       -2     
+ Partials         4        2       -2     
Impacted Files Coverage Δ
aws_lambda_powertools/logging/utils.py 100.00% <100.00%> (ø)
aws_lambda_powertools/shared/types.py 100.00% <0.00%> (ø)
aws_lambda_powertools/logging/logger.py 100.00% <0.00%> (ø)
aws_lambda_powertools/logging/formatter.py 100.00% <0.00%> (ø)
aws_lambda_powertools/event_handler/api_gateway.py 100.00% <0.00%> (ø)
...ambda_powertools/utilities/feature_flags/schema.py 100.00% <0.00%> (ø)
...owertools/utilities/feature_flags/feature_flags.py 100.00% <0.00%> (ø)
...s/utilities/data_classes/dynamo_db_stream_event.py 100.00% <0.00%> (ø)
...ools/utilities/idempotency/persistence/dynamodb.py 100.00% <0.00%> (+2.66%) ⬆️
aws_lambda_powertools/shared/functions.py 100.00% <0.00%> (+16.66%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 321f493...36420a2. Read the comment docs.

@github-actions github-actions bot added the feature New feature or functionality label Jan 4, 2022
@boring-cyborg boring-cyborg bot added the documentation Improvements or additions to documentation label Jan 5, 2022
@mploski mploski requested a review from heitorlessa January 5, 2022 10:56
docs/core/logger.md Outdated Show resolved Hide resolved
@heitorlessa heitorlessa marked this pull request as ready for review January 5, 2022 13:09
@heitorlessa heitorlessa changed the title feat(logger): enable powertools logging for imported libraries feat(logger): support cloning powertools logger config to registered loggers Jan 5, 2022
@heitorlessa heitorlessa changed the title feat(logger): support cloning powertools logger config to registered loggers feat(logger): clone powertools logger config to any Python logger Jan 5, 2022
@heitorlessa heitorlessa merged commit eab398c into aws-powertools:develop Jan 5, 2022
@boring-cyborg
Copy link

boring-cyborg bot commented Jan 5, 2022

Awesome work, congrats on your first merged pull request and thank you for helping improve everyone's experience!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation feature New feature or functionality size/L Denotes a PR that changes 100-499 lines, ignoring generated files. tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants