How to stop Firebase from updating registration status at application startup

When I launch the FireBase application, it logs the status of various Firebase features. Now this is what is being recorded:

Configuring the default app. <FIRAnalytics/INFO> Firebase Analytics v.3200000 started <FIRAnalytics/INFO> To enable debug logging set the following application argument: -FIRAnalyticsDebugEnabled (see ...) <FIRAnalytics/INFO> Successfully created Firebase Analytics App Delegate Proxy automatically. To disable the proxy, set the flag FirebaseAppDelegateProxyEnabled to NO in the Info.plist <FIRInstanceID/WARNING> FIRInstanceID AppDelegate proxy enabled, will swizzle app delegate remote notification handlers. To disable add "FirebaseAppDelegateProxyEnabled" to your Info.plist and set it to NO <FIRAnalytics/INFO> Firebase Analytics enabled 

I looked through the containers and did not find any print statements, since I could also stop them due to the fact that they were written in overtime. Am I launching an application?

+70
ios iphone firebase
May 18 '16 at 22:25
source share
9 answers

You can disable debugging logging with the -FIRDebugDisabled flag.

You can add it to scheme :

  • Select the Scheme Toolbar
  • Change Scheme
  • Select Run
  • Click Arguments and add -FIRDebugDisabled
+79
May 18 '16 at 10:49 PM
source share

Add FirebaseConfiguration.shared.setLoggerLevel(.min) to FirebaseApp.configure() to achieve the minimum amount of logging.

 func setupFirebase() { FirebaseConfiguration.shared.setLoggerLevel(.min) FirebaseApp.configure() } 
+43
Jul 06 '17 at 3:57 on
source share

By default, Firebase will log information, errors, and warnings.
Thus, you can set the level of the registrar that you will ever need. If you set for .Error, you will get a minimal log only on errors.

setLoggerLevel before FirebaseApp.configure () as shown below

In Swift 2.3 and Firebase 4

  FirebaseConfiguration.sharedInstance().setLoggerLevel(.Error) FirebaseApp.configure() 

In Swift 3 and Firebase 4

  FirebaseConfiguration.shared.setLoggerLevel(.min) FirebaseApp.configure() 
+12
Aug 18 '17 at 20:39 on
source share

In my case, to hide the extra part of the console log from Firebase, I did the following:

  1. Go to product โ†’ scheme โ†’ change scheme.
  2. On the Arguments tab, under Environment Variables, add OS_ACTIVITY_MODE = disable

enter image description here

  • In case you need it, just uncheck the box.
  • Disabling OS_ACTIVITY_MODE sometimes also disables logs for all exceptions



Edit : As @ jesus-adolfo-rodriguez said, this is due to Xcode. So if you do not want OSLog in the Xcode console, put the OS_ACTIVITY_MODE environment variable to "disable" in your schema.

+5
Sep 25 '17 at 10:43 on
source share

By default, Firebase Analytics will only log 4 INFO lines in production + errors / warnings. It should be very small if everything works correctly. Adding -noFIRAnalyticsDebugEnabled will disable DEBUG level logs and will always log ERROR / WARN. If you see any warnings or errors, you probably need to do something to resolve the cause. Some things most likely will not work correctly if warnings / errors are logged. An application that is configured correctly should not log errors / warnings.

Messages marked with FIRInstanceID / * are logged by Firebase Notification, and errors / warnings are always logged.

+4
May 23 '16 at 18:23
source share

Swift 4 Firebase 4.10

Set the logging level in your AppDelegate.swift

 FirebaseConfiguration().setLoggerLevel(FirebaseLoggerLevel.min) 

Here is the complete code:

 func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { FirebaseConfiguration().setLoggerLevel(FirebaseLoggerLevel.min) FirebaseApp.configure() return true } 
+4
Mar 08 '18 at 13:40
source share
 FIRConfiguration.sharedInstance().setLoggerLevel(.min) FIRApp.configure() 

In Swift 4

+4
May 7 '18 at 16:32
source share

As djabi said, you cannot disable these logs if they are INFO, WARNING or ERROR.

I want to add Nitin Gohel to the answer as I cannot comment: the FirebaseAppDelegateProxyEnabled flag is not intended to disable logs. If you turn it off, youโ€™ll lose tracking auto campaign , and you will need to add methods from FIRAnalytics (AppDelegate) to independently handle the URL and user activity.

+3
May 31 '16 at 15:28
source share

To add to the answer from Alex, from https://firebase.google.com/docs/cloud-messaging/ios/client

FirebaseAppDelegateProxyEnabled designed to test your application delegation methods

The FCM API implements the swizzling method in two key areas: mapping the APN token to the FCM registration token and capturing analytic data during message callback processing. Developers who prefer not to use swizzling can turn it off by adding the FirebaseAppDelegateProxyEnabled flag to the apps Info.plist file and setting it to NO (boolean). The relevant areas of the manuals contain code examples, both with and without the swizzling method.

+3
Jan 17 '17 at 13:21
source share



All Articles