aws-powertools / powertools-lambda-typescript

Powertools is a developer toolkit to implement Serverless best practices and increase developer velocity.
https://docs.powertools.aws.dev/lambda/typescript/latest/
MIT No Attribution
1.59k stars 143 forks source link

Feature request: change visibility from `private` to `protected` to allow overrides #3376

Closed zirkelc closed 5 days ago

zirkelc commented 1 week ago

Use case

As discussed before, I would like to suggest to change the visibility of certain methods of Logger from private to protected to allow overrides by subclassing Logger. A use case for such an override would be the buffering of log messages (see #3178).

If approved, I'm happy to submit a PR.

Solution/User Experience

The following methods could be made protected: https://github.com/aws-powertools/powertools-lambda-typescript/blob/0dc4de15e0ecb4d39585bd094a2d958be2d06bb2/packages/logger/src/Logger.ts#L703-L707

https://github.com/aws-powertools/powertools-lambda-typescript/blob/0dc4de15e0ecb4d39585bd094a2d958be2d06bb2/packages/logger/src/Logger.ts#L838

https://github.com/aws-powertools/powertools-lambda-typescript/blob/0dc4de15e0ecb4d39585bd094a2d958be2d06bb2/packages/logger/src/Logger.ts#L865-L869

Alternative solutions

Acknowledgment

Future readers

Please react with 👍 and your use case to help us understand customer demand.

dreamorosi commented 1 week ago

Hi @zirkelc, the proposal makes sense.

We discussed this in #3178, so feel free to open a PR to make these changes and I'll help you get it merged before the next release!

github-actions[bot] commented 5 days ago

⚠️ COMMENT VISIBILITY WARNING ⚠️

This issue is now closed. Please be mindful that future comments are hard for our team to see.

If you need more assistance, please either tag a team member or open a new issue that references this one.

If you wish to keep having a conversation with other community members under this issue feel free to do so.