Completely disable Firebase/Analytics to stop console spam on app startup

Swift 4.0:

FirebaseConfiguration.shared.setLoggerLevel(.min) FirebaseConfiguration.shared.analyticsConfiguration.setAnalyticsCollectionEnabled(false)


You can find this buried in the output:

<Notice> [Firebase/Analytics][I-ACS023008] To enable debug logging
 set the following application argument: -FIRAnalyticsDebugEnabled

Disabling is the opposite - set the argument: -noFIRAnalyticsDebugEnabled:

enter image description here

Additionally, you can control the default Firebase logging level with the setLoggerLevel method in FIRConfiguration. For example to disable all Firebase logging:

  [[FIRConfiguration sharedInstance] setLoggerLevel:FIRLoggerLevelMin];
  [FIRApp configure];

or in Swift:

FirebaseConfiguration.shared.setLoggerLevel(FirebaseLoggerLevel.min)
FirebaseApp.configure()

More details in the FIRLogger implementation here


To the best of my knowledge, these two lines:

[[FIRConfiguration sharedInstance] setLoggerLevel:FIRLoggerLevelMin];
[[FIRAnalyticsConfiguration sharedInstance] setAnalyticsCollectionEnabled:NO];

placed very early in the app delegate's didFinishLaunchingWithOptions: will completely disable FireBase analytics, including stopping all the console output.

I've also since discovered that the Google/SignIn cocoapod is deprecated - the recommended one to use is GoogleSignIn (ie. no '/'). If you use GoogleSignIn, then this doesn't have a dependency on Firebase Analytics, so the original problem goes away. Now I have Google Drive support in my app and don't have Firebase Analytics!