From e6ccd38828279a7a6abca2db11dcd3da73b07624 Mon Sep 17 00:00:00 2001 From: Mingshiou Wu Date: Tue, 20 May 2025 23:38:10 -0700 Subject: [PATCH] Remove debug logs PiperOrigin-RevId: 761386791 --- .../apple/Mediums/BLEv2/GNCBLEL2CAPConnection.m | 4 ---- .../implementation/apple/Mediums/BLEv2/GNCBLEL2CAPStream.m | 6 ++++-- internal/platform/implementation/apple/ble_l2cap_socket.mm | 5 ----- 3 files changed, 4 insertions(+), 11 deletions(-) diff --git a/internal/platform/implementation/apple/Mediums/BLEv2/GNCBLEL2CAPConnection.m b/internal/platform/implementation/apple/Mediums/BLEv2/GNCBLEL2CAPConnection.m index 1776d3f3..ef02844b 100644 --- a/internal/platform/implementation/apple/Mediums/BLEv2/GNCBLEL2CAPConnection.m +++ b/internal/platform/implementation/apple/Mediums/BLEv2/GNCBLEL2CAPConnection.m @@ -243,8 +243,6 @@ static NSData *PrefixLengthData(NSData *data) { } NSUInteger realDataLength = data.length - kL2CAPPacketLength; if (realDataLength < _expectedDataLength) { - GTMLoggerError(@"[NEARBY] Insufficient data. Expected: %lu, Actual: %lu", _expectedDataLength, - realDataLength); return nil; } else if (realDataLength == _expectedDataLength) { return [data subdataWithRange:NSMakeRange(kL2CAPPacketLength, realDataLength)]; @@ -252,8 +250,6 @@ static NSData *PrefixLengthData(NSData *data) { // This is a case where the data length is larger than the expected length. // The first |_expectedDataLength| bytes are copied and used as the actual data. The // remaining bytes will be stored in _undeliveredData for future use. - GTMLoggerInfo(@"[NEARBY] Data length mismatch. Expected: %lu, Actual: %lu", _expectedDataLength, - realDataLength); return [data subdataWithRange:NSMakeRange(kL2CAPPacketLength, _expectedDataLength)]; } } diff --git a/internal/platform/implementation/apple/Mediums/BLEv2/GNCBLEL2CAPStream.m b/internal/platform/implementation/apple/Mediums/BLEv2/GNCBLEL2CAPStream.m index c2e1f459..35191cb1 100644 --- a/internal/platform/implementation/apple/Mediums/BLEv2/GNCBLEL2CAPStream.m +++ b/internal/platform/implementation/apple/Mediums/BLEv2/GNCBLEL2CAPStream.m @@ -173,6 +173,8 @@ enum { READ_BUFFER_SIZE = 409600 }; case NSStreamEventHasSpaceAvailable: case NSStreamEventNone: default: + GTMLoggerInfo(@"[NEARBY] Received event %@ for stream %@", + [[self class] stringFromStreamEventCode:eventCode], stream); break; } return; @@ -183,7 +185,6 @@ enum { READ_BUFFER_SIZE = 409600 }; case NSStreamEventHasSpaceAvailable: { @synchronized(_writeBufferArray) { if (!_writeBufferArray.count) { - GTMLoggerInfo(@"[NEARBY] No data to write in buffer, setting flag"); _writeBufferReadyForData = YES; return; } @@ -197,6 +198,8 @@ enum { READ_BUFFER_SIZE = 409600 }; case NSStreamEventEndEncountered: case NSStreamEventNone: default: + GTMLoggerInfo(@"[NEARBY] Received event %@ for stream %@", + [[self class] stringFromStreamEventCode:eventCode], stream); break; } return; @@ -303,7 +306,6 @@ enum { READ_BUFFER_SIZE = 409600 }; /// Receives data from device and invokes |_receivedDataBlock|. - (void)receiveStreamData { dispatch_assert_queue_debug(_streamQueue); - uint8_t readBuffer[READ_BUFFER_SIZE]; NSInteger bytesRead = [self.inputStream read:readBuffer maxLength:READ_BUFFER_SIZE]; diff --git a/internal/platform/implementation/apple/ble_l2cap_socket.mm b/internal/platform/implementation/apple/ble_l2cap_socket.mm index 14062a4a..3c540722 100644 --- a/internal/platform/implementation/apple/ble_l2cap_socket.mm +++ b/internal/platform/implementation/apple/ble_l2cap_socket.mm @@ -83,8 +83,6 @@ ExceptionOr BleL2capInputStream::Read(std::int64_t size) { [condition_ unlock]; if (dataToReturn) { - GTMLoggerInfo(@"[NEARBY] BleL2capInputStream: Received data of size: %lu", - (unsigned long)dataToReturn.length); return ExceptionOr{ByteArray((const char *)dataToReturn.bytes, dataToReturn.length)}; } else { return ExceptionOr{Exception::kIo}; @@ -108,9 +106,6 @@ BleL2capOutputStream::~BleL2capOutputStream() { Exception BleL2capOutputStream::Write(const ByteArray &data) { [condition_ lock]; - GTMLoggerInfo(@"[NEARBY] BleL2capOutputStream: Sending data of size: %lu", - NSDataFromByteArray(data).length); - if (!connection_) { [condition_ unlock]; return {Exception::kIo};