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

feat(logger): log_event support event data classes (e.g. S3Event) #984

Merged
merged 1 commit into from
Jan 31, 2022

Conversation

michaelbrewer
Copy link
Contributor

Issue #, if available:

closes #947

Description of changes:

@event_source(data_class=S3Event)
@log.inject_lambda_context(log_event=True)
def lambda_handler(event: S3Event, context: LambdaContext):
   ...

Changes:

  • Add dict data from raw_event when available

Checklist

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Changes:
- Add dict data from raw_event when available

closes aws-powertools#947
@pull-request-size pull-request-size bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Jan 29, 2022
@github-actions github-actions bot added the bug Something isn't working label Jan 29, 2022
@codecov-commenter
Copy link

codecov-commenter commented Jan 29, 2022

Codecov Report

Merging #984 (354529f) into develop (ed7a978) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff            @@
##           develop     #984   +/-   ##
========================================
  Coverage    99.96%   99.96%           
========================================
  Files          119      119           
  Lines         5326     5326           
  Branches       607      607           
========================================
  Hits          5324     5324           
  Partials         2        2           
Impacted Files Coverage Δ
aws_lambda_powertools/logging/logger.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ed7a978...354529f. Read the comment docs.

@heitorlessa heitorlessa added p2 and removed bug Something isn't working labels Jan 31, 2022
@heitorlessa heitorlessa changed the title fix(logger): log_event does not serialize classes feat(logger): log_event support for event source data classes (e.g. S3Event) Jan 31, 2022
@github-actions github-actions bot added the feature New feature or functionality label Jan 31, 2022
@heitorlessa heitorlessa changed the title feat(logger): log_event support for event source data classes (e.g. S3Event) feat(logger): log_event support event data classes (e.g. S3Event) Jan 31, 2022
@heitorlessa heitorlessa merged commit ffa4a35 into aws-powertools:develop Jan 31, 2022
@heitorlessa heitorlessa deleted the fix-947 branch January 31, 2022 14:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or functionality p2 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.

Logger: log_event does not serialize classes
3 participants