Skip to content

Commit 72885c1

Browse files
j-piaseckimeta-codesync[bot]
authored andcommitted
Mark logger/react_native_log.h as a for-frameworks C++ API (#59105)
Summary: Pull Request resolved: #59105 `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] Reviewed By: cipolleschi Differential Revision: D125412015 fbshipit-source-id: 64b44c5d2ca703bee33ca0c33274417b54a47262
1 parent f9c7007 commit 72885c1

3 files changed

Lines changed: 4 additions & 1 deletion

File tree

‎packages/react-native/ReactCommon/logger/CMakeLists.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ add_library(logger OBJECT ${logger_SRC})
1313

1414
target_include_directories(logger PUBLIC .)
1515

16-
target_link_libraries(logger glog)
16+
target_link_libraries(logger glog react_cxxstableapi)
1717
target_compile_reactnative_options(logger PRIVATE)

‎packages/react-native/ReactCommon/logger/React-logger.podspec‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ Pod::Spec.new do |s|
3131

3232
add_rn_third_party_dependencies(s)
3333
add_rncore_dependency(s)
34+
s.dependency "React-cxxstableapi"
3435

3536
mark_as_react_native_build(s)
3637
end

‎packages/react-native/ReactCommon/logger/react_native_log.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
#pragma once
99

10+
#include <react/cxxstableapi/FrameworksGuard.h>
11+
1012
enum ReactNativeLogLevel {
1113
ReactNativeLogLevelInfo = 1,
1214
ReactNativeLogLevelWarning = 2,

0 commit comments

Comments
 (0)