From 74b62db27e3ab5d83183df3a22e45cca13c6d8e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9C=A8=20Sang=20Lin?= Date: Thu, 7 Nov 2024 12:33:25 -0800 Subject: [PATCH] Use pass in logger for ml modules --- CHANGELOG.md | 2 ++ src/providers/BackgroundBlurProvider/index.tsx | 6 ++---- src/providers/BackgroundReplacementProvider/index.tsx | 6 ++---- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8fd66c6d..cc9c0d57 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +- Change to use loggers from `LoggerProvider` as default when initialize background blur/replacement processor. + ### Fixed ## [3.9.0] - 2024-04-12 diff --git a/src/providers/BackgroundBlurProvider/index.tsx b/src/providers/BackgroundBlurProvider/index.tsx index 3050fc77..f0c346a2 100644 --- a/src/providers/BackgroundBlurProvider/index.tsx +++ b/src/providers/BackgroundBlurProvider/index.tsx @@ -158,12 +158,10 @@ export const BackgroundBlurProvider: FC> = ({ ); const currentProcessor = await initializeBackgroundBlur(); try { - const logger = - options?.logger || - new ConsoleLogger('BackgroundBlurProvider', LogLevel.INFO); + const optionsLogger = options?.logger || logger; if (currentProcessor) { const chosenVideoTransformDevice = new DefaultVideoTransformDevice( - logger, + optionsLogger, selectedDevice, [currentProcessor] ); diff --git a/src/providers/BackgroundReplacementProvider/index.tsx b/src/providers/BackgroundReplacementProvider/index.tsx index aa1742ff..a6f11f97 100644 --- a/src/providers/BackgroundReplacementProvider/index.tsx +++ b/src/providers/BackgroundReplacementProvider/index.tsx @@ -160,12 +160,10 @@ export const BackgroundReplacementProvider: FC< ); const currentProcessor = await initializeBackgroundReplacement(); try { - const logger = - options?.logger || - new ConsoleLogger('BackgroundReplacementProvider', LogLevel.INFO); + const optionsLogger = options?.logger || logger; if (currentProcessor) { const chosenVideoTransformDevice = new DefaultVideoTransformDevice( - logger, + optionsLogger, selectedDevice, [currentProcessor] );