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): include logger name attribute when copy_config_to_registered_logger is used #1568

Conversation

heitorlessa
Copy link
Contributor

@heitorlessa heitorlessa commented Oct 4, 2022

Issue number: #1267

Summary

Changes

Please provide a summary of what's being changed

This change adds the standard logging attribute name when copying configuration from a Powertools Logger to all (or a set) registered loggers.

User experience

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

BEFORE

[
    {
        "level": "INFO",
        "location": "<module>:16",
        "message": "Name should be equal service value",
        "timestamp": "2022-06-29 16:56:11,789+0200",
        "service": "payment",
    },
    {
        "level": "INFO",
        "location": "<module>:17",
        "message": "Something random",
        "timestamp": "2022-06-29 16:56:11,789+0200",
        "service": "payment",
    }
]

AFTER

[
    {
        "level": "INFO",
        "location": "<module>:16",
        "message": "Name should be equal service value",
        "timestamp": "2022-06-29 16:56:11,789+0200",
        "service": "payment",
        "name": "payment"
    },
    {
        "level": "INFO",
        "location": "<module>:17",
        "message": "Something random",
        "timestamp": "2022-06-29 16:56:11,789+0200",
        "service": "payment",
        "name": "my_dependency_logger"
    }
]

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.


View rendered docs/core/logger.md

@heitorlessa heitorlessa requested a review from a team as a code owner October 4, 2022 15:17
@heitorlessa heitorlessa requested review from am29d and removed request for a team October 4, 2022 15:17
@pull-request-size pull-request-size bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Oct 4, 2022
@boring-cyborg boring-cyborg bot added area/logger documentation Improvements or additions to documentation tests labels Oct 4, 2022
@heitorlessa heitorlessa requested review from leandrodamascena and removed request for am29d October 4, 2022 15:17
@github-actions github-actions bot added the feature New feature or functionality label Oct 4, 2022
@codecov-commenter
Copy link

Codecov Report

Base: 99.73% // Head: 99.73% // Increases project coverage by +0.00% 🎉

Coverage data is based on head (a68b57d) compared to base (9545f69).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #1568   +/-   ##
========================================
  Coverage    99.73%   99.73%           
========================================
  Files          124      124           
  Lines         5731     5732    +1     
  Branches       653      653           
========================================
+ Hits          5716     5717    +1     
  Misses           8        8           
  Partials         7        7           
Impacted Files Coverage Δ
aws_lambda_powertools/logging/utils.py 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@heitorlessa heitorlessa linked an issue Oct 4, 2022 that may be closed by this pull request
2 tasks
@leandrodamascena leandrodamascena self-assigned this Oct 4, 2022
@heitorlessa
Copy link
Contributor Author

Thanks Ruben!! Merging now.

@heitorlessa heitorlessa merged commit 18ac4ae into aws-powertools:develop Oct 5, 2022
@heitorlessa heitorlessa deleted the logger/add-logger-name-on-config-copy branch October 5, 2022 10:28
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/S Denotes a PR that changes 10-29 lines, ignoring generated files. tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature request: Include name of standard library loggers
4 participants