Skip to content

refactor(logger): use LogLevelThreshold constant inside Logger class #3133

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 4 commits into from
Sep 30, 2024

Conversation

arnabrahman
Copy link
Contributor

@arnabrahman arnabrahman commented Sep 28, 2024

Summary

The PR removes the local LogLevelThreshold object from Logger class and replaces it with LogLevelThreshold constant.

Changes

  • Removed the LogLevelThreshold object from the Logger class and replaced it with the LogLevelThreshold constant.
  • Removed the LogLevelThresholds type and its exports.
  • Performed housekeeping, the private logLevel property of the Logger class now uses the value from LogLevelThreshold instead of hardcoding the value.

Issue number: #2525


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.

@arnabrahman arnabrahman requested a review from a team September 28, 2024 14:18
@arnabrahman arnabrahman requested a review from a team as a code owner September 28, 2024 14:18
@boring-cyborg boring-cyborg bot added the logger This item relates to the Logger Utility label Sep 28, 2024
@pull-request-size pull-request-size bot added the size/M PR between 30-99 LOC label Sep 28, 2024
Copy link

@arnabrahman
Copy link
Contributor Author

arnabrahman commented Sep 28, 2024

When I was pushing to git, the pre-push hook was failing. It was failing at 100% test coverage

Screenshot from 2024-09-28 19-54-07

However if i run it from inside the logger, it passes

Screenshot from 2024-09-28 20-02-40

I created a test branch with just a comment change for logger & tried to push it, but it gave me the same error. Coverage was failing.

I tried the same for idempotency, changed a comment & tried to push to git and it also gave a coverage error.
Screenshot from 2024-09-28 20-24-37

I tried the same with parser package & tried to push it, this time the git push didn't give me any error. The parser package doesn't have vitest configured.

So, I am guessing the issue has something to do with vitest, maybe?

@github-actions github-actions bot added the enhancement PRs that introduce minor changes, usually to existing features label Sep 30, 2024

This comment was marked as off-topic.

@github-actions github-actions bot added do-not-merge This item should not be merged need-issue This PR needs an issue before it can be reviewed/worked on further labels Sep 30, 2024
@dreamorosi dreamorosi removed do-not-merge This item should not be merged need-issue This PR needs an issue before it can be reviewed/worked on further labels Sep 30, 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.

Thank you for the PR @arnabrahman, appreciate it.

About the test coverage problem, I have opened an issue (#3134) and will look into fixing it asap. Thanks for reporting it and apologies for the confusion during the work.

@dreamorosi dreamorosi merged commit 6781331 into aws-powertools:main Sep 30, 2024
30 checks passed
@arnabrahman arnabrahman deleted the 2525-loglevel-threshold branch September 30, 2024 08:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement PRs that introduce minor changes, usually to existing features logger This item relates to the Logger Utility size/M PR between 30-99 LOC
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature request: Provide ability to refernce and modify Log Level Numerical Thresholds
2 participants