cleanup logging

// FREEBIE
pull/1/head
Michael Kirk 8 years ago
parent 55d0db8c46
commit d71b7684a6

@ -17,7 +17,6 @@
#import <SignalServiceKit/TSCall.h> #import <SignalServiceKit/TSCall.h>
#import <SignalServiceKit/TSInvalidIdentityKeyReceivingErrorMessage.h> #import <SignalServiceKit/TSInvalidIdentityKeyReceivingErrorMessage.h>
#import <SignalServiceKit/TSStorageManager+SessionStore.h> #import <SignalServiceKit/TSStorageManager+SessionStore.h>
#import <SignalServiceKit/OWSProfileKeyMessage.h>
#import <SignalServiceKit/TSThread.h> #import <SignalServiceKit/TSThread.h>
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN

@ -844,15 +844,17 @@ NS_ASSUME_NONNULL_BEGIN
{ {
NSString *recipientId = incomingEnvelope.source; NSString *recipientId = incomingEnvelope.source;
if (!dataMessage.hasProfileKey) { if (!dataMessage.hasProfileKey) {
OWSFail(@"%@ received profile key message without profile key from recipient: %@", self.tag, recipientId); OWSFail(@"%@ received profile key message without profile key from: %@",
self.tag,
envelopeAddress(incomingEnvelope));
return; return;
} }
NSData *profileKey = dataMessage.profileKey; NSData *profileKey = dataMessage.profileKey;
if (profileKey.length != kAES256_KeyByteLength) { if (profileKey.length != kAES256_KeyByteLength) {
OWSFail(@"%@ received profile key of unexpected length:%lu from recipient: %@", OWSFail(@"%@ received profile key of unexpected length:%lu from:%@",
self.tag, self.tag,
(unsigned long)profileKey.length, (unsigned long)profileKey.length,
recipientId); envelopeAddress(incomingEnvelope));
return; return;
} }
@ -1001,12 +1003,18 @@ NS_ASSUME_NONNULL_BEGIN
break; break;
} }
case OWSSignalServiceProtosGroupContextTypeDeliver: { case OWSSignalServiceProtosGroupContextTypeDeliver: {
DDLogDebug(@"%@ incoming message from: %@ for group: %@ with timestampe: %lu", if (body.length == 0) {
self.tag, DDLogWarn(@"%@ ignoring empty incoming message from: %@ for group: %@ with timestampe: %lu",
envelopeAddress(envelope), self.tag,
groupId, envelopeAddress(envelope),
(unsigned long)timestamp); groupId,
if (body.length > 0) { (unsigned long)timestamp);
} else {
DDLogDebug(@"%@ incoming message from: %@ for group: %@ with timestampe: %lu",
self.tag,
envelopeAddress(envelope),
groupId,
(unsigned long)timestamp);
incomingMessage = [[TSIncomingMessage alloc] initWithTimestamp:timestamp incomingMessage = [[TSIncomingMessage alloc] initWithTimestamp:timestamp
inThread:gThread inThread:gThread
authorId:envelope.source authorId:envelope.source
@ -1026,11 +1034,16 @@ NS_ASSUME_NONNULL_BEGIN
thread = gThread; thread = gThread;
} else { } else {
DDLogDebug(@"%@ incoming message from: %@ with timestampe: %lu", if (body.length == 0) {
self.tag, DDLogWarn(@"%@ ignoring empty incoming message from: %@ with timestampe: %lu",
envelopeAddress(envelope), self.tag,
(unsigned long)timestamp); envelopeAddress(envelope),
if (body.length > 0) { (unsigned long)timestamp);
} else {
DDLogDebug(@"%@ incoming message from: %@ with timestampe: %lu",
self.tag,
envelopeAddress(envelope),
(unsigned long)timestamp);
TSContactThread *cThread = [TSContactThread getOrCreateThreadWithContactId:envelope.source TSContactThread *cThread = [TSContactThread getOrCreateThreadWithContactId:envelope.source
transaction:transaction transaction:transaction
relay:envelope.relay]; relay:envelope.relay];

Loading…
Cancel
Save