Skip to content

refactor(logger): replace EnvironmentVariablesService class with helper functions #4251

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

jaimellamasi
Copy link

@jaimellamasi jaimellamasi commented Aug 2, 2025

Summary

Changes

This PR removes the legacy class-based EnvironmentVariablesService methods from the Logger package.

Issue number: closes #4116


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/M PR between 30-99 LOC label Aug 2, 2025
@boring-cyborg boring-cyborg bot added the logger This item relates to the Logger Utility label Aug 2, 2025
Copy link

boring-cyborg bot commented Aug 2, 2025

Thanks a lot for your first contribution! Please check out our contributing guidelines and don't hesitate to ask whatever you need.
In the meantime, check out the #typescript channel on our Powertools for AWS Lambda Discord: Invite link

@pull-request-size pull-request-size bot added size/L PRs between 100-499 LOC and removed size/M PR between 30-99 LOC labels Aug 3, 2025
@boring-cyborg boring-cyborg bot added the tests PRs that add or change tests label Aug 3, 2025
Copy link

sonarqubecloud bot commented Aug 3, 2025

@@ -169,6 +182,21 @@ describe('Class: EnvironmentVariablesService', () => {
expect(value).toEqual(0.01);
});

it.each([undefined, ''])(
Copy link
Contributor

Choose a reason for hiding this comment

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

Since we removed all usage of EnvironmentVariablesService from the Logger class, we should also remove the files for the EnvironmentVariablesService itself - this should also make this test redundant.

Copy link
Author

Choose a reason for hiding this comment

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

in order to fully remove EnvironmentVariablesService class from Logger, I think we need to remove it from PowertoolsLogFormatter constructor and so also refactor LogFormatter. I was not sure if this was expected on this PR, but sure I can do it just let me know

Copy link
Contributor

Choose a reason for hiding this comment

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

Hi sorry if the issue wasn't clear- yes, please, let's do that too if you don't mind!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
logger This item relates to the Logger Utility size/L PRs between 100-499 LOC tests PRs that add or change tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Maintenance: replace EnvironmentVariablesService class with helper functions in Logger
3 participants