Remove debug logs

PiperOrigin-RevId: 761386791
This commit is contained in:
Mingshiou Wu
2025-05-20 23:39:32 -07:00
committed by Copybara-Service
parent eaa0d99c3e
commit e6ccd38828
3 changed files with 4 additions and 11 deletions
@@ -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)];
}
}
@@ -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];
@@ -83,8 +83,6 @@ ExceptionOr<ByteArray> 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>{ByteArray((const char *)dataToReturn.bytes, dataToReturn.length)};
} else {
return ExceptionOr<ByteArray>{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};