From df97dec2fedb741ba65478d63be7a160ead7d811 Mon Sep 17 00:00:00 2001 From: Maarten Billemont Date: Tue, 12 May 2020 10:54:15 -0400 Subject: [PATCH] Sentry user login & MPError arguments. --- platform-darwin/Source/MPAppDelegate_Key.m | 1 + platform-darwin/Source/MPAppDelegate_Shared.m | 5 ++--- platform-darwin/Source/MPTypes.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/platform-darwin/Source/MPAppDelegate_Key.m b/platform-darwin/Source/MPAppDelegate_Key.m index 9a9a277e..682b8933 100644 --- a/platform-darwin/Source/MPAppDelegate_Key.m +++ b/platform-darwin/Source/MPAppDelegate_Key.m @@ -201,6 +201,7 @@ } @try { + [SentrySDK setUser:[[SentryUser alloc] initWithUserId:user.userID]]; [Countly.sharedInstance userLoggedIn:user.userID]; [Countly.sharedInstance recordEvent:@"login" segmentation:@{ diff --git a/platform-darwin/Source/MPAppDelegate_Shared.m b/platform-darwin/Source/MPAppDelegate_Shared.m index dc7a6c91..8edc73a0 100644 --- a/platform-darwin/Source/MPAppDelegate_Shared.m +++ b/platform-darwin/Source/MPAppDelegate_Shared.m @@ -116,9 +116,8 @@ static MPAppDelegate_Shared *instance; if (self.activeUserOID == activeUserOID || [self.activeUserOID isEqual:activeUserOID]) return; - if (self.key) - self.key = nil; - + self.key = nil; + [SentrySDK setUser:nil]; [Countly.sharedInstance userLoggedOut]; self.activeUserOID = activeUserOID; diff --git a/platform-darwin/Source/MPTypes.h b/platform-darwin/Source/MPTypes.h index 12db47e0..cf76762b 100644 --- a/platform-darwin/Source/MPTypes.h +++ b/platform-darwin/Source/MPTypes.h @@ -41,7 +41,7 @@ __END_DECLS \ if (__error && [[MPConfig get].sendInfo boolValue]) { \ SentryEvent *event = [[SentryEvent alloc] initWithLevel:kSentryLevelError]; \ - event.message = strf(@"%@: %@", message_, [__error localizedDescription]); \ + event.message = strf( message_ @": %@", ##__VA_ARGS__, [__error localizedDescription]); \ event.logger = @"MPError"; \ [SentrySDK captureEvent:event]; \ } \