mirror of
https://github.com/oxen-io/session-ios.git
synced 2023-12-13 21:30:14 +01:00
Respond to CR.
// FREEBIE
This commit is contained in:
parent
b17a7c5751
commit
fa7a2407bf
|
@ -44,7 +44,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
|
||||
#define kOWSAnalyticsParameterEnvelopeIsLegacy @"envelope_is_legacy"
|
||||
#define kOWSAnalyticsParameterEnvelopeHasContent @"has_content"
|
||||
#define kOWSAnalyticsParameterEnvelopeDescription @"envelope_description"
|
||||
#define kOWSAnalyticsParameterEnvelopeType @"envelope_type"
|
||||
#define kOWSAnalyticsParameterEnvelopeEncryptedLength @"encrypted_length"
|
||||
|
||||
#define AnalyticsParametersFromEnvelope(__envelope) \
|
||||
|
@ -53,11 +53,15 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
return (@{ \
|
||||
kOWSAnalyticsParameterEnvelopeIsLegacy : @(__envelope.hasLegacyMessage), \
|
||||
kOWSAnalyticsParameterEnvelopeHasContent : @(__envelope.hasContent), \
|
||||
kOWSAnalyticsParameterEnvelopeDescription : [self descriptionForEnvelopeType:__envelope], \
|
||||
kOWSAnalyticsParameterEnvelopeType : [self descriptionForEnvelopeType:__envelope], \
|
||||
kOWSAnalyticsParameterEnvelopeEncryptedLength : @(__encryptedData.length), \
|
||||
}); \
|
||||
}
|
||||
|
||||
// The debug logs can be more verbose than the analytics events.
|
||||
//
|
||||
// In this case `descriptionForEnvelope` is valuable enough to
|
||||
// log but too dangerous to include in the analytics event.
|
||||
#define OWSProdErrorWEnvelope(__analyticsEventName, __envelope) \
|
||||
{ \
|
||||
DDLogError(@"%s:%d %@: %@", \
|
||||
|
|
|
@ -129,12 +129,20 @@ typedef NSDictionary<NSString *, id> *_Nonnull (^OWSProdAssertParametersBlock)()
|
|||
|
||||
#define OWSProdCFail(__analyticsEventName) OWSProdCFailWParams(__analyticsEventName, nil)
|
||||
|
||||
// The debug logs can be more verbose than the analytics events.
|
||||
//
|
||||
// In this case `debugDescription` is valuable enough to
|
||||
// log but too dangerous to include in the analytics event.
|
||||
#define OWSProdFailWNSError(__analyticsEventName, __nserror) \
|
||||
{ \
|
||||
DDLogError(@"%s:%d %@: %@", __PRETTY_FUNCTION__, __LINE__, __analyticsEventName, __nserror.debugDescription); \
|
||||
OWSProdFailWParams(__analyticsEventName, AnalyticsParametersFromNSError(__nserror)) \
|
||||
}
|
||||
|
||||
// The debug logs can be more verbose than the analytics events.
|
||||
//
|
||||
// In this case `exception` is valuable enough to
|
||||
// log but too dangerous to include in the analytics event.
|
||||
#define OWSProdFailWNSException(__analyticsEventName, __exception) \
|
||||
{ \
|
||||
DDLogError(@"%s:%d %@: %@", __PRETTY_FUNCTION__, __LINE__, __analyticsEventName, __exception); \
|
||||
|
@ -168,12 +176,20 @@ typedef NSDictionary<NSString *, id> *_Nonnull (^OWSProdAssertParametersBlock)()
|
|||
|
||||
#define OWSProdError(__analyticsEventName) OWSProdEventWParams(OWSAnalyticsSeverityError, __analyticsEventName, nil)
|
||||
|
||||
// The debug logs can be more verbose than the analytics events.
|
||||
//
|
||||
// In this case `debugDescription` is valuable enough to
|
||||
// log but too dangerous to include in the analytics event.
|
||||
#define OWSProdErrorWNSError(__analyticsEventName, __nserror) \
|
||||
{ \
|
||||
DDLogError(@"%s:%d %@: %@", __PRETTY_FUNCTION__, __LINE__, __analyticsEventName, __nserror.debugDescription); \
|
||||
OWSProdErrorWParams(__analyticsEventName, AnalyticsParametersFromNSError(__nserror)) \
|
||||
}
|
||||
|
||||
// The debug logs can be more verbose than the analytics events.
|
||||
//
|
||||
// In this case `exception` is valuable enough to
|
||||
// log but too dangerous to include in the analytics event.
|
||||
#define OWSProdErrorWNSException(__analyticsEventName, __exception) \
|
||||
{ \
|
||||
DDLogError(@"%s:%d %@: %@", __PRETTY_FUNCTION__, __LINE__, __analyticsEventName, __exception); \
|
||||
|
@ -194,6 +210,10 @@ typedef NSDictionary<NSString *, id> *_Nonnull (^OWSProdAssertParametersBlock)()
|
|||
OWSProdCriticalWParams(__analyticsEventName, AnalyticsParametersFromNSError(__nserror)) \
|
||||
}
|
||||
|
||||
// The debug logs can be more verbose than the analytics events.
|
||||
//
|
||||
// In this case `exception` is valuable enough to
|
||||
// log but too dangerous to include in the analytics event.
|
||||
#define OWSProdCriticalWNSException(__analyticsEventName, __exception) \
|
||||
{ \
|
||||
DDLogError(@"%s:%d %@: %@", __PRETTY_FUNCTION__, __LINE__, __analyticsEventName, __exception); \
|
||||
|
|
Loading…
Reference in a new issue