每当我启动FireBase应用程序时,它都会记录各种Firebase功能的状态。现在,这是正在记录的内容:
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
我查看了一下pod,没有找到任何print语句,所以如果运行应用程序,我如何阻止这些语句被超时记录呢?
发布于 2017-07-06 11:57:42
在FirebaseApp.configure()
之前添加FirebaseConfiguration.shared.setLoggerLevel(.min)
,以实现最小的日志记录量。
func setupFirebase() {
FirebaseConfiguration.shared.setLoggerLevel(.min)
FirebaseApp.configure()
}
发布于 2017-08-19 04:39:51
默认情况下,Firebase将记录信息、错误和警告。
所以你可以设置你需要的记录器级别。
如果您设置为.Error,则仅当出现错误时才会获得最小日志。
FirebaseApp.configure()之前的setLoggerLevel,如下所示
在Swift 2.3和Firebase 4中
FirebaseConfiguration.sharedInstance().setLoggerLevel(.Error)
FirebaseApp.configure()
在Swift 3和Firebase 4中
FirebaseConfiguration.shared.setLoggerLevel(.min)
FirebaseApp.configure()
发布于 2018-03-08 21:40:15
Swift 4 Firebase 4.10
在AppDelegate.swift中设置记录器级别
FirebaseConfiguration().setLoggerLevel(FirebaseLoggerLevel.min)
下面是完整的代码:
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
FirebaseConfiguration().setLoggerLevel(FirebaseLoggerLevel.min)
FirebaseApp.configure()
return true
}
https://stackoverflow.com/questions/37311089
复制相似问题