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

docs(logger): add logEventIfEnabled() docs #2924

Merged
merged 7 commits into from
Aug 16, 2024
Merged

Conversation

dreamorosi
Copy link
Contributor

Summary

Changes

Please provide a summary of what's being changed

This PR adds to both the documentation and API docs info about the previously undocumented logEventIfEnabled() method in Logger.

This method allows customers who are not using Middy.js middleware nor class method decorators to optionally log the incoming event when the POWERTOOLS_LOGGER_LOG_EVENT environment variable is set to true.

The updated section in the Logger docs looks like this:
Screenshot 2024-08-14 at 12 14 25

The newly added code example, and its tooltip, look like this:
Screenshot 2024-08-14 at 12 14 30

Similar tooltips have been added to the Middy.js middleware and class method decorator examples:
Screenshot 2024-08-14 at 12 14 42

Finally, I have also added an example event and output to show what it's going to be logged:
Screenshot 2024-08-14 at 12 14 49

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

Issue number: closes #1904


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.

@dreamorosi dreamorosi self-assigned this Aug 14, 2024
@boring-cyborg boring-cyborg bot added documentation Improvements or additions to documentation logger This item relates to the Logger Utility labels Aug 14, 2024
@pull-request-size pull-request-size bot added the size/L PRs between 100-499 LOC label Aug 14, 2024
@dreamorosi dreamorosi marked this pull request as ready for review August 16, 2024 08:32
@dreamorosi dreamorosi requested review from a team as code owners August 16, 2024 08:32
Copy link
Contributor

@leandrodamascena leandrodamascena left a comment

Choose a reason for hiding this comment

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

Just a small text correction, but not mandatory. Feel free to not accept and merge without them.

examples/snippets/logger/logEventDecorator.ts Outdated Show resolved Hide resolved
examples/snippets/logger/logEventManual.ts Outdated Show resolved Hide resolved
examples/snippets/logger/logEventMiddy.ts Outdated Show resolved Hide resolved
Co-authored-by: Leandro Damascena <leandro.damascena@gmail.com>
dreamorosi and others added 2 commits August 16, 2024 12:13
Co-authored-by: Leandro Damascena <leandro.damascena@gmail.com>
Co-authored-by: Leandro Damascena <leandro.damascena@gmail.com>
@dreamorosi
Copy link
Contributor Author

Just a small text correction, but not mandatory. Feel free to not accept and merge without them.

No, they are good suggestions - accepted all of them.

Copy link

Copy link
Contributor

@leandrodamascena leandrodamascena left a comment

Choose a reason for hiding this comment

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

APPROVED!

@dreamorosi dreamorosi merged commit 5eadaef into main Aug 16, 2024
9 checks passed
@dreamorosi dreamorosi deleted the docs/logger_logEvent branch August 16, 2024 10:16
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 logger This item relates to the Logger Utility size/L PRs between 100-499 LOC
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature request: Support Logging Incoming Event Without Use of Middy or Class
2 participants