diff --git a/react-native/src/index.js b/react-native/src/index.js index 3789aa8..3ee5798 100644 --- a/react-native/src/index.js +++ b/react-native/src/index.js @@ -1904,21 +1904,25 @@ class FFmpegKitInitializer { this.#initialized = true; } - console.log("Loading ffmpeg-kit-react-native."); - this.#eventEmitter.addListener(eventLogCallbackEvent, FFmpegKitInitializer.processLogCallbackEvent); this.#eventEmitter.addListener(eventStatisticsCallbackEvent, FFmpegKitInitializer.processStatisticsCallbackEvent); this.#eventEmitter.addListener(eventCompleteCallbackEvent, FFmpegKitInitializer.processCompleteCallbackEvent); - FFmpegKitFactory.setLogLevel(await FFmpegKitReactNativeModule.getLogLevel()); - const version = FFmpegKitFactory.getVersion(); - const platform = await FFmpegKitConfig.getPlatform(); - const arch = await ArchDetect.getArch(); - const packageName = await Packages.getPackageName(); - await FFmpegKitConfig.enableRedirection(); - const isLTSPostfix = (await FFmpegKitConfig.isLTSBuild()) ? "-lts" : ""; + const logLevel = await FFmpegKitReactNativeModule.getLogLevel() + + FFmpegKitFactory.setLogLevel(logLevel); + - console.log(`Loaded ffmpeg-kit-react-native-${platform}-${packageName}-${arch}-${version}${isLTSPostfix}.`); + if(logLevel === "debug") { + const version = FFmpegKitFactory.getVersion(); + const platform = await FFmpegKitConfig.getPlatform(); + const arch = await ArchDetect.getArch(); + const packageName = await Packages.getPackageName(); + await FFmpegKitConfig.enableRedirection(); + const isLTSPostfix = (await FFmpegKitConfig.isLTSBuild()) ? "-lts" : ""; + + console.log(`Loaded ffmpeg-kit-react-native-${platform}-${packageName}-${arch}-${version}${isLTSPostfix}.`); + } } }