Skip to content

fix(logger): support additional args for handlers when injecting lambda context #1276

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

Conversation

RonRademaker
Copy link
Contributor

@RonRademaker RonRademaker commented Jul 4, 2022

Issue number: #1277

Summary

Changes

Preserve args and kwargs in the logger.inject_lambda_context decorator

User experience

After @heitorlessa 's talk at our meetup last Thursday I tried to add the logger to our project. The lambda handler was already decorated with a couple of decorators, one of which injects additional parameters into the handler. The decorator did not support this, simply passing on args and kwargs fixes this issue and allows the decorator to be used on lambda handlers that support additional arguments.

Checklist

If your change doesn't seem to apply, please leave them unchecked.

Acknowledgment

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.

@pull-request-size pull-request-size bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Jul 4, 2022
@boring-cyborg
Copy link

boring-cyborg bot commented Jul 4, 2022

Thanks a lot for your first contribution! Please check out our contributing guidelines and don't hesitate to ask whatever you need.

@github-actions github-actions bot added the bug Something isn't working label Jul 4, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Jul 4, 2022

No related issues found. Please ensure there is an open issue related to this change to avoid significant delays or closure.

@github-actions github-actions bot added do-not-merge need-issue PRs that are missing related issues labels Jul 4, 2022
@heitorlessa
Copy link
Contributor

hey @RonRademaker thanks a lot for this it's a no brainer to add in this week's release (EOW). Could you create bug issue so we can backtrack it in the future?

@RonRademaker
Copy link
Contributor Author

hey @RonRademaker thanks a lot for this it's a no brainer to add in this week's release (EOW). Could you create bug issue so we can backtrack it in the future?

Added a report here #1277

@heitorlessa heitorlessa removed do-not-merge need-issue PRs that are missing related issues labels Jul 4, 2022
@heitorlessa
Copy link
Contributor

Thanks a lot @RonRademaker - we'll make a release later today and notify you once it's available by EOD

@heitorlessa heitorlessa changed the title fix(logger): support additional args for a lambda handler when injecting lambda context fix(logger): support additional args for handlers when injecting lambda context Jul 4, 2022
@heitorlessa heitorlessa merged commit 3ffcc14 into aws-powertools:develop Jul 4, 2022
@boring-cyborg
Copy link

boring-cyborg bot commented Jul 4, 2022

Awesome work, congrats on your first merged pull request and thank you for helping improve everyone's experience!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working size/S Denotes a PR that changes 10-29 lines, ignoring generated files. tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants