diff --git a/RadarSDK/Radar.m b/RadarSDK/Radar.m index fa93814f..fd746de6 100644 --- a/RadarSDK/Radar.m +++ b/RadarSDK/Radar.m @@ -1358,23 +1358,11 @@ - (void)dealloc { [[NSNotificationCenter defaultCenter] removeObserver:self]; } -+ (BOOL)canFlushLogs { - NSString *publishableKey = [RadarSettings publishableKey]; - if ([publishableKey hasPrefix:@"prj_test_pk"] || [publishableKey hasPrefix:@"org_test_pk"] || [RadarSettings userDebug] || ([RadarSettings sdkConfiguration].logLevel && [RadarSettings sdkConfiguration].logLevel != RadarLogLevelNone)) { - return YES; - } - return NO; -} - + (void)sendLog:(RadarLogLevel)level type:(RadarLogType)type message:(NSString *_Nonnull)message { [[RadarLogBuffer sharedInstance] write:level type:type message:message ]; } + (void)flushLogs { - if (![self canFlushLogs]) { - return; - } - NSArray *flushableLogs = [[RadarLogBuffer sharedInstance] flushableLogs]; NSUInteger pendingLogCount = [flushableLogs count]; if (pendingLogCount == 0) { diff --git a/RadarSDK/RadarSettings.m b/RadarSDK/RadarSettings.m index 1f55dc90..43776da0 100644 --- a/RadarSDK/RadarSettings.m +++ b/RadarSDK/RadarSettings.m @@ -238,7 +238,7 @@ + (void)setSdkConfiguration:(RadarSdkConfiguration *)sdkConfiguration { [RadarUtils dictionaryToJson:[sdkConfiguration dictionaryValue]]]]; if (sdkConfiguration) { [[RadarLogBuffer sharedInstance] setPersistentLogFeatureFlag:sdkConfiguration.useLogPersistence]; - [[NSUserDefaults standardUserDefaults] setInteger:(int)sdkConfiguration.logLevel forKey:kLogLevel]; + [RadarSettings setLogLevel:sdkConfiguration.logLevel]; [[NSUserDefaults standardUserDefaults] setObject:[sdkConfiguration dictionaryValue] forKey:kSdkConfiguration]; } else { [[RadarLogBuffer sharedInstance] setPersistentLogFeatureFlag:NO]; @@ -264,7 +264,7 @@ + (RadarLogLevel)logLevel { } + (void)setLogLevel:(RadarLogLevel)level { - + [[NSUserDefaults standardUserDefaults] setInteger:(int)level forKey:kLogLevel]; } + (NSArray *_Nullable)beaconUUIDs {