Enable Nearby logger writer for iOS

PiperOrigin-RevId: 764442996
This commit is contained in:
Guogang Li
2025-05-28 15:33:29 -07:00
committed by Copybara-Service
parent 132d04348d
commit 5e37ee44f4
2 changed files with 15 additions and 1 deletions
+6 -1
View File
@@ -52,7 +52,12 @@ cc_library(
"@com_google_absl//absl/container:flat_hash_map",
"@com_google_absl//absl/strings",
"@com_google_absl//absl/types:span",
],
] + select({
"@platforms//os:platform_ios": [
"//internal/platform/implementation/apple:logger_writer",
],
"//conditions:default": [],
}),
)
# iOS only.
+9
View File
@@ -49,6 +49,9 @@
#include "internal/platform/byte_array.h"
#include "internal/platform/file.h"
#include "internal/platform/logging.h"
#if TARGET_OS_IOS
#include "internal/platform/implementation/apple/nearby_logger_writer.h"
#endif // TARGET_OS_IOS
namespace nearby::connections {
class Core;
@@ -221,6 +224,12 @@ NcContext* GetContext(NC_INSTANCE instance) {
NC_INSTANCE NcCreateService() {
NcContext nc_context;
#if TARGET_OS_IOS
#if DEBUG
absl::SetGlobalVLogLevel(1);
#endif // DEBUG
::nearby::apple::EnableNearbyLoggerWriter();
#endif // TARGET_OS_IOS
#if defined(NC_IOS_SDK)
nearby::NearbyFlags::GetInstance().OverrideBoolFlagValue(