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

Use pass in logger for ml modules #969

Merged
merged 1 commit into from
Nov 8, 2024
Merged

Use pass in logger for ml modules #969

merged 1 commit into from
Nov 8, 2024

Conversation

linsang21
Copy link
Contributor

Issue #:

Description of changes:
Default to logger from logger provider when initiate bgBlur, bgReplacement processors

Testing

  1. Have you successfully run npm run build:release locally? yes

  2. How did you test these changes? Test using react meeting demo

  3. If you made changes to the component library, have you provided corresponding documentation changes?

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

@linsang21 linsang21 requested a review from a team as a code owner November 7, 2024 20:57
const logger =
options?.logger ||
new ConsoleLogger('BackgroundBlurProvider', LogLevel.INFO);
const optionsLogger = options?.logger || logger;
Copy link
Contributor

Choose a reason for hiding this comment

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

This is after the initialize right? We pass the logger to DefaultVideoTransformDevice

@@ -51,7 +49,8 @@ export const BackgroundBlurProvider: FC<React.PropsWithChildren<Props>> = ({
options,
children,
}) => {
const logger = useLogger();
let logger = useLogger();
logger = options?.logger || logger;
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not just one line let logger = options?.logger || useLogger() ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

there's warning for conditionally calling hooks

Copy link

@georgezy-amzn georgezy-amzn Nov 7, 2024

Choose a reason for hiding this comment

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

how about const logger = options?.logger ?? useLogger() ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

same warning

@linsang21 linsang21 merged commit c42aed1 into main Nov 8, 2024
1 of 2 checks passed
@linsang21 linsang21 deleted the ml-logger branch November 8, 2024 00:28
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.

4 participants