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

chore: Logging AOT Support #628

Merged
merged 38 commits into from
Sep 23, 2024

Conversation

hjgraca
Copy link
Contributor

@hjgraca hjgraca commented Aug 2, 2024

Please provide the issue number

Issue number: #212

Summary

Changes

  • Logging support for native AOT
  • .NET 8 specific serialization paths
  • New helper method to convert anonymous types to dictionary, use for source generation .NET 8
  • Removed PowertoolsLambdaContext now uses ILambdaContext
  • Removed dependency from IMethodAspectHandler, now using LoggingAspectFactory to boostrap Logging Aspect
  • Added a new Source Generator - PowertoolsSourceGeneratorSerializer to be used in Lambda bootstrap

User experience

With the new PowertoolsSourceGeneratorSerializer, we can combine Powertools SerlializationContext with the customer Serialization context, this enables Powertools to serialize customer only types, this is useful for LogEvent feature.

image

Checklist

Please leave checklist items unchecked if they do not apply to your change.

Is this a breaking change?

RFC issue number:

Checklist:

  • Migration process documented
  • Implement warnings (if it can live side by side)

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.

…fic paths. New helper method to convert anonymous types to dictionary, use for source generation .NET 8
@boring-cyborg boring-cyborg bot added area/logging Core logging utility tests labels Aug 2, 2024
@auto-assign auto-assign bot requested review from amirkaws and sliedig August 2, 2024 10:13
@pull-request-size pull-request-size bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Aug 2, 2024
@hjgraca hjgraca added the aot label Aug 2, 2024
@hjgraca hjgraca added this to the .NET AOT milestone Aug 2, 2024
@github-actions github-actions bot added the internal Maintenance changes label Aug 2, 2024
Copy link

codecov bot commented Aug 2, 2024

Codecov Report

Attention: Patch coverage is 87.38899% with 71 lines in your changes missing coverage. Please review.

Project coverage is 72.94%. Comparing base (5a483b7) to head (e1d1181).
Report is 43 commits behind head on develop.

Files with missing lines Patch % Lines
...ambda.Powertools.Logging/Internal/LoggingAspect.cs 74.82% 32 Missing and 4 partials ⚠️
...Serializers/PowertoolsSourceGeneratorSerializer.cs 55.00% 7 Missing and 2 partials ⚠️
...ging/Internal/PowertoolsConfigurationsExtension.cs 96.73% 1 Missing and 4 partials ⚠️
.../Internal/Converters/ExceptionPropertyExtractor.cs 66.66% 4 Missing ⚠️
...ogging/Internal/Helpers/PowertoolsLoggerHelpers.cs 76.47% 2 Missing and 2 partials ⚠️
...raries/src/AWS.Lambda.Powertools.Logging/Logger.cs 63.63% 1 Missing and 3 partials ⚠️
....Logging/Internal/Converters/ExceptionConverter.cs 50.00% 3 Missing ⚠️
...da.Powertools.Logging/Internal/PowertoolsLogger.cs 96.00% 1 Missing and 2 partials ⚠️
...Powertools.Common/Core/PowertoolsConfigurations.cs 50.00% 0 Missing and 1 partial ⚠️
...owertools.Logging/Internal/LoggingLambdaContext.cs 97.14% 0 Missing and 1 partial ⚠️
... and 1 more
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #628      +/-   ##
===========================================
+ Coverage    72.71%   72.94%   +0.22%     
===========================================
  Files          190      195       +5     
  Lines         7886     7986     +100     
  Branches       850      854       +4     
===========================================
+ Hits          5734     5825      +91     
- Misses        1862     1876      +14     
+ Partials       290      285       -5     
Flag Coverage Δ
unittests 72.94% <87.38%> (+0.22%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@boring-cyborg boring-cyborg bot added area/common Core Powertools utility documentation Improvements or additions to documentation labels Aug 29, 2024
@pull-request-size pull-request-size bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Aug 29, 2024
@pull-request-size pull-request-size bot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Sep 11, 2024
@hjgraca hjgraca changed the title chore: Logging AOT Support WIP chore: Logging AOT Support Sep 16, 2024
@hjgraca
Copy link
Contributor Author

hjgraca commented Sep 18, 2024

  • documentation

Copy link
Contributor

@amirkaws amirkaws left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link

sonarcloud bot commented Sep 23, 2024

@hjgraca hjgraca merged commit 335eef7 into aws-powertools:develop Sep 23, 2024
8 checks passed
@github-actions github-actions bot added the pending-release Fix or implementation already in dev waiting to be released label Sep 24, 2024
@hjgraca hjgraca deleted the aot(logging)-support-logging branch October 10, 2024 13:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
aot area/common Core Powertools utility area/logging Core logging utility documentation Improvements or additions to documentation internal Maintenance changes pending-release Fix or implementation already in dev waiting to be released size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. tests
Projects
Status: Comming soon
Development

Successfully merging this pull request may close these issues.

2 participants