Skip to content

Commit

Permalink
fix: SDK 初始化时的版本日志 level 改成 info,并兼容 debugEnabled 配置
Browse files Browse the repository at this point in the history
  • Loading branch information
YoloMao committed Jun 24, 2021
1 parent 1a33a6b commit 1c5dcb9
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 11 deletions.
2 changes: 1 addition & 1 deletion GrowingTrackerCore/Event/GrowingEventManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ - (void)postEventBuidler:(GrowingBaseBuilder *_Nullable)builder {
}

if (!GrowingConfigurationManager.sharedInstance.trackConfiguration.dataCollectionEnabled) {
GIOLogWarn(@"Data collection is disabled, event can not build");
GIOLogDebug(@"Data collection is disabled, event can not build");
return;
}

Expand Down
2 changes: 1 addition & 1 deletion GrowingTrackerCore/FileStorage/GrowingFileStorage.m
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ - (NSData *)dataForKey:(NSString *)key {
NSURL *url = [self urlForKey:key];
NSData *data = [NSData dataWithContentsOfURL:url];
if (!data) {
GIOLogWarn(@"WARNING: No data file for key %@", key);
GIOLogDebug(@"WARNING: No data file for key %@", key);
return nil;
}
if (self.crypto) {
Expand Down
10 changes: 2 additions & 8 deletions GrowingTrackerCore/GrowingRealTracker.m
Original file line number Diff line number Diff line change
Expand Up @@ -58,20 +58,14 @@ + (instancetype)trackerWithConfiguration:(GrowingTrackConfiguration *)configurat
}

- (void)loggerSetting {
if (self.configuration.debugEnabled) {
[GrowingLog addLogger:[GrowingTTYLogger sharedInstance] withLevel:GrowingLogLevelDebug];
} else {
[GrowingLog removeLogger:[GrowingTTYLogger sharedInstance]];
[GrowingLog addLogger:[GrowingTTYLogger sharedInstance] withLevel:GrowingLogLevelError];
}

[GrowingLog addLogger:[GrowingTTYLogger sharedInstance] withLevel:self.configuration.debugEnabled ? GrowingLogLevelDebug : GrowingLogLevelInfo];
[GrowingLog addLogger:[GrowingWSLogger sharedInstance] withLevel:GrowingLogLevelVerbose];
[GrowingWSLogger sharedInstance].logFormatter = [GrowingWSLoggerFormat new];
}

- (void)versionPrint {
NSString *versionStr = [NSString stringWithFormat:@"Thank you very much for using GrowingIO. We will do our best to provide you with the best service. GrowingIO version: %@",GrowingTrackerVersionName];
GIOLogError(@"%@",versionStr);
GIOLogInfo(@"%@", versionStr);
}

- (void)trackCustomEvent:(NSString *)eventName {
Expand Down
2 changes: 1 addition & 1 deletion GrowingTrackerCore/Manager/GrowingSession.m
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ - (void)resendVisitByUserIdDidChangedFrom:(NSString *)oldUserId to:(NSString *)n
- (void)applicationDidBecomeActive {
// 第一次启动,且已经发送过visit事件,说明visit事件被强制补发了,这里就不在发送visit事件了
if (self.latestDidEnterBackgroundTime == 0 && self.alreadySendVisitEvent) {
GIOLogWarn(@"First launched and already send visit");
GIOLogDebug(@"First launched and already send visit");
return;
}

Expand Down

0 comments on commit 1c5dcb9

Please sign in to comment.