From ccd30e0e1fc16cefed7592729e16e5971e03c5b1 Mon Sep 17 00:00:00 2001 From: Michael Kirk Date: Fri, 26 Oct 2018 16:41:07 -0600 Subject: [PATCH] more logging --- .../src/Network/API/OWSUploadOperation.m | 5 ++++- .../src/Network/WebSockets/OWSWebSocket.m | 17 ++++++++++++++--- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/SignalServiceKit/src/Network/API/OWSUploadOperation.m b/SignalServiceKit/src/Network/API/OWSUploadOperation.m index 9be213a73..32a071c93 100644 --- a/SignalServiceKit/src/Network/API/OWSUploadOperation.m +++ b/SignalServiceKit/src/Network/API/OWSUploadOperation.m @@ -168,7 +168,10 @@ static const CGFloat kAttachmentUploadProgressTheta = 0.001f; return; } - OWSLogInfo(@"Uploaded attachment: %p.", attachmentStream.uniqueId); + OWSLogInfo(@"Uploaded attachment: %p serverId: %llu, byteCount: %u", + attachmentStream.uniqueId, + attachmentStream.serverId, + attachmentStream.byteCount); attachmentStream.serverId = serverId; attachmentStream.isUploaded = YES; [attachmentStream saveAsyncWithCompletionBlock:^{ diff --git a/SignalServiceKit/src/Network/WebSockets/OWSWebSocket.m b/SignalServiceKit/src/Network/WebSockets/OWSWebSocket.m index 8bb09d3d2..ad7757151 100644 --- a/SignalServiceKit/src/Network/WebSockets/OWSWebSocket.m +++ b/SignalServiceKit/src/Network/WebSockets/OWSWebSocket.m @@ -143,6 +143,16 @@ NSString *const kNSNotification_OWSWebSocketStateDidChange = @"kNSNotification_O #pragma mark - +NSString *NSStringFromOWSWebSocketType(OWSWebSocketType type) +{ + switch (type) { + case OWSWebSocketTypeDefault: + return @"Default"; + case OWSWebSocketTypeUD: + return @"UD"; + } +} + // OWSWebSocket's properties should only be accessed from the main thread. @interface OWSWebSocket () @@ -563,11 +573,12 @@ NSString *const kNSNotification_OWSWebSocketStateDidChange = @"kNSNotification_O [socketMessage didFailBeforeSending]; return; } - OWSLogVerbose(@"message scheduled: %llu, %@, %@, %zd.", + OWSLogInfo(@"making request: %llu, %@: %@, jsonData.length: %zd, socketType: %@", socketMessage.requestId, request.HTTPMethod, requestPath, - jsonData.length); + jsonData.length, + NSStringFromOWSWebSocketType(self.webSocketType)); const int64_t kSocketTimeoutSeconds = 10; __weak TSSocketMessage *weakSocketMessage = socketMessage; @@ -592,7 +603,7 @@ NSString *const kNSNotification_OWSWebSocketStateDidChange = @"kNSNotification_O { OWSAssertDebug(message); - OWSLogInfo(@"received WebSocket response."); + OWSLogInfo(@"received WebSocket response requestId: %llu, status: %u", message.requestID, message.status); DispatchMainThreadSafe(^{ [self requestSocketAliveForAtLeastSeconds:kMakeRequestKeepSocketAliveDurationSeconds];