From 091727d16ea7d975421c092d4ec93cf240184735 Mon Sep 17 00:00:00 2001 From: Jakub Piasecki Date: Thu, 15 Oct 2026 04:19:52 -0700 Subject: [PATCH] Mark `logger/react_native_log.h` as a for-frameworks C++ API Summary: `react_native_log.h` is how host integrations install a sink for React Native's native logs (`set_react_native_logfunc`, `ReactNativeLogLevel`). It is not reached from any public header, so classify it in the "for frameworks" tier of the C++ stable API by including `FrameworksGuard.h`. Consumers opting into `RN_STRICT_API` get a suppressible warning (silenced with `RN_ALLOW_FRAMEWORKS`) instead of no classification. The `logger` target now depends on `cxxstableapi` in BUCK, CMake and CocoaPods. Changelog: [Internal] Differential Revision: D125412015 --- packages/react-native/ReactCommon/logger/CMakeLists.txt | 2 +- packages/react-native/ReactCommon/logger/React-logger.podspec | 1 + packages/react-native/ReactCommon/logger/react_native_log.h | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/react-native/ReactCommon/logger/CMakeLists.txt b/packages/react-native/ReactCommon/logger/CMakeLists.txt index acb0c52267f8..d4d185c31448 100644 --- a/packages/react-native/ReactCommon/logger/CMakeLists.txt +++ b/packages/react-native/ReactCommon/logger/CMakeLists.txt @@ -13,5 +13,5 @@ add_library(logger OBJECT ${logger_SRC}) target_include_directories(logger PUBLIC .) -target_link_libraries(logger glog) +target_link_libraries(logger glog react_cxxstableapi) target_compile_reactnative_options(logger PRIVATE) diff --git a/packages/react-native/ReactCommon/logger/React-logger.podspec b/packages/react-native/ReactCommon/logger/React-logger.podspec index 771445962e6a..7fcfe7f4e875 100644 --- a/packages/react-native/ReactCommon/logger/React-logger.podspec +++ b/packages/react-native/ReactCommon/logger/React-logger.podspec @@ -31,6 +31,7 @@ Pod::Spec.new do |s| add_rn_third_party_dependencies(s) add_rncore_dependency(s) + s.dependency "React-cxxstableapi" mark_as_react_native_build(s) end diff --git a/packages/react-native/ReactCommon/logger/react_native_log.h b/packages/react-native/ReactCommon/logger/react_native_log.h index 7b7b4f6a713e..78a086563b5f 100644 --- a/packages/react-native/ReactCommon/logger/react_native_log.h +++ b/packages/react-native/ReactCommon/logger/react_native_log.h @@ -7,6 +7,8 @@ #pragma once +#include + enum ReactNativeLogLevel { ReactNativeLogLevelInfo = 1, ReactNativeLogLevelWarning = 2,