From 2b6f605b3c237361d030748b39074bde2beed59a Mon Sep 17 00:00:00 2001 From: Pieter De Baets Date: Fri, 5 Jun 2026 14:44:14 -0700 Subject: [PATCH] Remove unreferenced RCTDefaultCxxLogFunction (#57085) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/57085 Nothing has accessed this in a while. Changelog: [General][Removed] Removed RCTDefaultCxxLogFunction Reviewed By: christophpurrer Differential Revision: D107636249 fbshipit-source-id: 2f993c4fe5b901e584aadf05e19042ac43efa111 --- .../CxxLogUtils/RCTDefaultCxxLogFunction.h | 16 --------- .../CxxLogUtils/RCTDefaultCxxLogFunction.mm | 34 ------------------- .../api-snapshots/ReactAppleDebugCxx.api | 1 - .../api-snapshots/ReactAppleNewarchCxx.api | 1 - .../api-snapshots/ReactAppleReleaseCxx.api | 1 - 5 files changed, 53 deletions(-) delete mode 100644 packages/react-native/React/CxxLogUtils/RCTDefaultCxxLogFunction.h delete mode 100644 packages/react-native/React/CxxLogUtils/RCTDefaultCxxLogFunction.mm diff --git a/packages/react-native/React/CxxLogUtils/RCTDefaultCxxLogFunction.h b/packages/react-native/React/CxxLogUtils/RCTDefaultCxxLogFunction.h deleted file mode 100644 index 36a2abad242..00000000000 --- a/packages/react-native/React/CxxLogUtils/RCTDefaultCxxLogFunction.h +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -#pragma once - -#import - -namespace facebook::react { - -void RCTDefaultCxxLogFunction(ReactNativeLogLevel level, const char *message); - -} // namespace facebook::react diff --git a/packages/react-native/React/CxxLogUtils/RCTDefaultCxxLogFunction.mm b/packages/react-native/React/CxxLogUtils/RCTDefaultCxxLogFunction.mm deleted file mode 100644 index 138dc553c68..00000000000 --- a/packages/react-native/React/CxxLogUtils/RCTDefaultCxxLogFunction.mm +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -#import "RCTDefaultCxxLogFunction.h" -#import -#import - -namespace facebook::react { - -void RCTDefaultCxxLogFunction(ReactNativeLogLevel level, const char *message) -{ - switch (level) { - case ReactNativeLogLevelInfo: - LOG(INFO) << message; - RCTLogInfo(@"%@", [NSString stringWithUTF8String:message]); - break; - case ReactNativeLogLevelWarning: - LOG(WARNING) << message; - RCTLogWarn(@"%@", [NSString stringWithUTF8String:message]); - break; - case ReactNativeLogLevelError: - LOG(ERROR) << message; - RCTLogError(@"%@", [NSString stringWithUTF8String:message]); - break; - case ReactNativeLogLevelFatal: - LOG(FATAL) << message; - } -} - -} // namespace facebook::react diff --git a/scripts/cxx-api/api-snapshots/ReactAppleDebugCxx.api b/scripts/cxx-api/api-snapshots/ReactAppleDebugCxx.api index 026291c9bf6..34fb35faf45 100644 --- a/scripts/cxx-api/api-snapshots/ReactAppleDebugCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactAppleDebugCxx.api @@ -3879,7 +3879,6 @@ uint8_t facebook::react::blueFromColor(facebook::react::SharedColor color) noexc uint8_t facebook::react::greenFromColor(facebook::react::SharedColor color) noexcept; uint8_t facebook::react::redFromColor(facebook::react::SharedColor color) noexcept; void facebook::react::FBReactNativeSpec_registerComponentDescriptorsFromCodegen(std::shared_ptr registry); -void facebook::react::RCTDefaultCxxLogFunction(ReactNativeLogLevel level, const char* message); void facebook::react::bindHasComponentProvider(facebook::jsi::Runtime& runtime, facebook::react::HasComponentProviderFunctionType&& provider); void facebook::react::bindNativeLogger(facebook::jsi::Runtime& runtime, facebook::react::Logger logger); void facebook::react::bindNativePerformanceNow(facebook::jsi::Runtime& runtime); diff --git a/scripts/cxx-api/api-snapshots/ReactAppleNewarchCxx.api b/scripts/cxx-api/api-snapshots/ReactAppleNewarchCxx.api index 3cc8ba4fe00..7f341310bcb 100644 --- a/scripts/cxx-api/api-snapshots/ReactAppleNewarchCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactAppleNewarchCxx.api @@ -3864,7 +3864,6 @@ uint8_t facebook::react::blueFromColor(facebook::react::SharedColor color) noexc uint8_t facebook::react::greenFromColor(facebook::react::SharedColor color) noexcept; uint8_t facebook::react::redFromColor(facebook::react::SharedColor color) noexcept; void facebook::react::FBReactNativeSpec_registerComponentDescriptorsFromCodegen(std::shared_ptr registry); -void facebook::react::RCTDefaultCxxLogFunction(ReactNativeLogLevel level, const char* message); void facebook::react::bindHasComponentProvider(facebook::jsi::Runtime& runtime, facebook::react::HasComponentProviderFunctionType&& provider); void facebook::react::bindNativeLogger(facebook::jsi::Runtime& runtime, facebook::react::Logger logger); void facebook::react::bindNativePerformanceNow(facebook::jsi::Runtime& runtime); diff --git a/scripts/cxx-api/api-snapshots/ReactAppleReleaseCxx.api b/scripts/cxx-api/api-snapshots/ReactAppleReleaseCxx.api index c347a55a535..b20a27166d5 100644 --- a/scripts/cxx-api/api-snapshots/ReactAppleReleaseCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactAppleReleaseCxx.api @@ -3879,7 +3879,6 @@ uint8_t facebook::react::blueFromColor(facebook::react::SharedColor color) noexc uint8_t facebook::react::greenFromColor(facebook::react::SharedColor color) noexcept; uint8_t facebook::react::redFromColor(facebook::react::SharedColor color) noexcept; void facebook::react::FBReactNativeSpec_registerComponentDescriptorsFromCodegen(std::shared_ptr registry); -void facebook::react::RCTDefaultCxxLogFunction(ReactNativeLogLevel level, const char* message); void facebook::react::bindHasComponentProvider(facebook::jsi::Runtime& runtime, facebook::react::HasComponentProviderFunctionType&& provider); void facebook::react::bindNativeLogger(facebook::jsi::Runtime& runtime, facebook::react::Logger logger); void facebook::react::bindNativePerformanceNow(facebook::jsi::Runtime& runtime);