Skip to content

feat(logger): change visibility to protected #3377

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

Merged
merged 5 commits into from
Nov 29, 2024

Conversation

zirkelc
Copy link
Contributor

@zirkelc zirkelc commented Nov 28, 2024

Summary

Change the visibility of Logger methods from private to protected to allow subclassing of Logger to add new functionaility

Changes

Please provide a summary of what's being changed

Please add the issue number below, if no issue is present the PR might get blocked and not be reviewed

Issue number: #3376


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.

@zirkelc zirkelc requested a review from a team November 28, 2024 06:55
@zirkelc zirkelc requested a review from a team as a code owner November 28, 2024 06:55
@boring-cyborg boring-cyborg bot added the logger This item relates to the Logger Utility label Nov 28, 2024
@pull-request-size pull-request-size bot added the size/S PR between 10-29 LOC label Nov 28, 2024
Copy link
Contributor

@dreamorosi dreamorosi left a comment

Choose a reason for hiding this comment

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

I see that you changed more methods and properties than the ones we discussed in #3376.

I would be inclined to stick to the initial plan and revert the other changes, or if the initial list of methods discussed are not enough to cover your use case, close the PR and invest time in shipping the feature for everyone within the boundaries of the public API.

The reason why we're reticent with making everything accessible is that we don't want to create the false expectation that all these methods/properties are there to stay.

Our commitment to avoiding breaking changes extends exclusively to public methods. Any other method or property is to be considered internal for all intents and purposes.

This is also why we're gradually moving away from private and have started using actual JavaScript private fields (i.e. private getLogLevelNameFromNumber() becomes #getLogLevelNameFromNumber()).

@pull-request-size pull-request-size bot added size/XS PR between 0-9 LOC and removed size/S PR between 10-29 LOC labels Nov 28, 2024
@zirkelc
Copy link
Contributor Author

zirkelc commented Nov 28, 2024

I changed the additional methods/properties back to private, please have a look.

There is one optional comment about this.console: it would be useful to have this accessible from subclasses, but it's not required. I can work around that.

Copy link
Contributor

@dreamorosi dreamorosi left a comment

Choose a reason for hiding this comment

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

Thank you for addressing my comments.

Looking forward to collaborating on the RFC!

@dreamorosi dreamorosi merged commit 93a19a5 into aws-powertools:main Nov 29, 2024
37 checks passed
@github-actions github-actions bot added the feature PRs that introduce new features or minor changes label Nov 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature PRs that introduce new features or minor changes logger This item relates to the Logger Utility size/XS PR between 0-9 LOC
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature request: change visibility from private to protected to allow overrides
2 participants