Google SDK在Xcode中记录两次

Jak*_*lář 2 logging ios firebase firebase-analytics

我从Google服务中获取了两次所有记录的消息.使用Google Analytics的标准Google实施进行测试.(这个标准配置代码被调用一次 - 即使它无关紧要)

// Configure tracker from GoogleService-Info.plist.
NSError *configureError;
[[GGLContext sharedInstance] configureWithError:&configureError];
NSAssert(!configureError, @"Error configuring Google services: %@", configureError);

// Optional: configure GAI options.
GAI *gai = [GAI sharedInstance];
gai.trackUncaughtExceptions = YES;  // report uncaught exceptions
gai.logger.logLevel = kGAILogLevelVerbose;  // remove before app release
Run Code Online (Sandbox Code Playgroud)

日志:

2016-10-23 22:06:22.354166 [692:208692] [Firebase/Core][I-COR000001] Configuring the default app.
2016-10-23 22:06:22.354 [692] <Debug> [Firebase/Core][I-COR000001] Configuring the default app.
2016-10-23 22:06:22.374475 [692:208692] <FIRAnalytics/INFO> Firebase Analytics v.3404000 started
2016-10-23 22:06:22.374 [692:] <FIRAnalytics/INFO> Firebase Analytics v.3404000 started
...
Run Code Online (Sandbox Code Playgroud)

怎么会?

Tod*_*man 5

我认为这是Xcode 8的额外冗长的情况.我已经看到这种情况发生在Xcode 8运行的实际设备(而不仅仅是模拟器).

我敢肯定,如果您启用OS_ACTIVITY_MODE = disable环境变量(如中提到的这篇文章),这种双重记录就会消失.

但要明确的是,这只是Xcode打印出额外内容到控制台的情况.Firebase分析本身不会记录它通常执行的事件的两倍.