Jakub Truhlář Jakub Truhlář - 1 year ago 209
iOS Question

Google SDK logging twice in Xcode

I'm getting every logged messages twice from Google services. Tested with standard Google implementation for Google analytics. (This standard configuration code is called once - even if it does not matter anyway)

// 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


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

How come?

Answer Source

I think this is a case of Xcode 8 being extra verbose. I've seen this happen with Xcode 8 running with an actual device (instead of just the simulator).

I'm pretty sure if you enable the OS_ACTIVITY_MODE = disable environment variable (as mentioned in this post), this double-logging should go away.

But to be clear, this is just a case of Xcode printing out extra stuff to the console. Firebase analytics itself isn't logging twice the events that it normally does.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download