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: add data logging api in defineData #2359

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open

Conversation

bobbyu99
Copy link
Contributor

@bobbyu99 bobbyu99 commented Dec 19, 2024

Changes

This PR added data logging options in defineData. Summary of changes:

  • bumped data-construct version to consume the new logging api
  • added DataLogLevel type
  • added enum converter DataLogLevelConverter and logging options parser convertLoggingOptionsToCDK
  • modified data factory to parse logging options

Validation

Unit tests added for:

  • enum converter DataLogLevelConverter
  • logging options parser convertLoggingOptionsToCDK
  • defineData with logging options

Checklist

  • If this PR includes a functional change to the runtime behavior of the code, I have added or updated automated test coverage for this change.
  • If this PR requires a change to the Project Architecture README, I have included that update in this PR.
  • If this PR requires a docs update, I have linked to that docs PR above.
  • If this PR modifies E2E tests, makes changes to resource provisioning, or makes SDK calls, I have run the PR checks with the run-e2e label set.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@bobbyu99 bobbyu99 requested review from a team as code owners December 19, 2024 20:31
Copy link
Member

@sobolk sobolk left a comment

Choose a reason for hiding this comment

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

LGTM.

We should move couple of things around to reduce public api additions.

packages/plugin-types/API.md Outdated Show resolved Hide resolved
packages/platform-core/src/cdk/enum_converters.ts Outdated Show resolved Hide resolved
packages/client-config/API.md Outdated Show resolved Hide resolved
* - The generated request/response functions that were resolved for each field.
* @default 'none'
*/
level?: DataLogLevel;
Copy link
Contributor

@Amplifiyer Amplifiyer Dec 19, 2024

Choose a reason for hiding this comment

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

Should this be named fieldLogLevel just as you described in the default example in the docs above?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for catching the discrepancy in the doc. fieldLogLevel is used in the cdk. But I think level as the API is more straightforward and aligns with what we already have in defineFunction. What do you think?

Copy link
Member

Choose a reason for hiding this comment

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

Does AppSync have other log levels ? for example modelLogLevel ?
If it does have it or have potential to have it in the future then - would we add second "level property" here or use this level to feed both?

Copy link
Contributor Author

@bobbyu99 bobbyu99 Dec 20, 2024

Choose a reason for hiding this comment

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

I don't find any other log level besides fieldLogLevel. I'm confirming if AppSync has plan to add other log levels.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But thanks for the catch. I think it's better to name it fieldLogLevel for clarity and to differentiate in case AppSync has plan later to add other log level

Copy link

changeset-bot bot commented Dec 19, 2024

🦋 Changeset detected

Latest commit: aa42129

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 6 packages
Name Type
@aws-amplify/backend-function Minor
@aws-amplify/platform-core Minor
@aws-amplify/backend-data Minor
@aws-amplify/plugin-types Minor
@aws-amplify/backend-ai Minor
@aws-amplify/backend Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants