Skip to content

Commit

Permalink
Merge branch 'master' into kenny/deep-linking-spike
Browse files Browse the repository at this point in the history
  • Loading branch information
KennyHuRadar authored Oct 7, 2024
2 parents fd817c0 + 6d25648 commit f128851
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 14 deletions.
12 changes: 0 additions & 12 deletions RadarSDK/Radar.m
Original file line number Diff line number Diff line change
Expand Up @@ -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<RadarLog *> *flushableLogs = [[RadarLogBuffer sharedInstance] flushableLogs];
NSUInteger pendingLogCount = [flushableLogs count];
if (pendingLogCount == 0) {
Expand Down
4 changes: 2 additions & 2 deletions RadarSDK/RadarSettings.m
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand All @@ -264,7 +264,7 @@ + (RadarLogLevel)logLevel {
}

+ (void)setLogLevel:(RadarLogLevel)level {

[[NSUserDefaults standardUserDefaults] setInteger:(int)level forKey:kLogLevel];
}

+ (NSArray<NSString *> *_Nullable)beaconUUIDs {
Expand Down

0 comments on commit f128851

Please sign in to comment.