Skip to content

Commit

Permalink
change log level reference to that stored in sdkconfiguration (#390)
Browse files Browse the repository at this point in the history
* change log level referecne to that stored in sdkconfiguration

* Update RadarSDK/Radar.m

Co-authored-by: Liam Meier <[email protected]>

---------

Co-authored-by: Liam Meier <[email protected]>
  • Loading branch information
KennyHuRadar and lmeier authored Sep 13, 2024
1 parent 2b20369 commit 947b790
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions RadarSDK/Radar.m
Original file line number Diff line number Diff line change
Expand Up @@ -1295,9 +1295,9 @@ - (void)dealloc {
[[NSNotificationCenter defaultCenter] removeObserver:self];
}

+ (BOOL)isTestKey {
+ (BOOL)canFlushLogs {
NSString *publishableKey = [RadarSettings publishableKey];
if ([publishableKey hasPrefix:@"prj_test_pk"] || [publishableKey hasPrefix:@"org_test_pk"] || [RadarSettings userDebug]) {
if ([publishableKey hasPrefix:@"prj_test_pk"] || [publishableKey hasPrefix:@"org_test_pk"] || [RadarSettings userDebug] || ([RadarSettings sdkConfiguration].logLevel && [RadarSettings sdkConfiguration].logLevel != RadarLogLevelNone)) {
return YES;
}
return NO;
Expand All @@ -1308,7 +1308,7 @@ + (void)sendLog:(RadarLogLevel)level type:(RadarLogType)type message:(NSString *
}

+ (void)flushLogs {
if (![self isTestKey]) {
if (![self canFlushLogs]) {
return;
}

Expand Down

0 comments on commit 947b790

Please sign in to comment.