完全禁用Firebase/Analytics(分析)以在应用程序启动时停止控制台垃圾邮件 [英] Completely disable Firebase/Analytics to stop console spam on app startup
问题描述
我已经将Google/Signin cocoapod安装到了我的应用程序中(我需要支持GoogleDrive),但是它依赖于Google/Core,后者依赖于FirebaseAnalytics.我不需要或不需要FirebaseAnalytics.
I've installed Google/SignIn cocoapod into my application (which I need to support GoogleDrive), but it depends on Google/Core which depends on FirebaseAnalytics. I don't want or need FirebaseAnalytics.
FirebaseAnalytics在我们的应用启动时向开发人员控制台发送8行输出的垃圾邮件:
FirebaseAnalytics spams the developer console with 8 lines of output when our app starts:
2017-06-07 18:07:19.612994+0100 son[2909:877661] [Firebase/Analytics][I-ACS005000] The AdSupport Framework is not currently linked. Some features will not function properly. Learn more at http://gooX.gl/9vSsPb
2017-06-07 18:07:19.613 son[2909] <Warning> [Firebase/Analytics][I-ACS005000] The AdSupport Framework is not currently linked. Some features will not function properly. Learn more at http://gooX.gl/9vSsPb
2017-06-07 18:07:19.613896+0100 son[2909:877661] [Firebase/Analytics][I-ACS023007] Firebase Analytics v.3900000 started
2017-06-07 18:07:19.614 son[2909] <Notice> [Firebase/Analytics][I-ACS023007] Firebase Analytics v.3900000 started
2017-06-07 18:07:19.614525+0100 son[2909:877661] [Firebase/Analytics][I-ACS023008] To enable debug logging set the following application argument: -FIRAnalyticsDebugEnabled (see http://gooX.gl/RfcP7r)
2017-06-07 18:07:19.614 son[2909] <Notice> [Firebase/Analytics][I-ACS023008] To enable debug logging set the following application argument: -FIRAnalyticsDebugEnabled (see http://gooX.gl/RfcP7r)
2017-06-07 18:07:19.622560+0100 son[2909:877662] [Firebase/Analytics][I-ACS023013] Firebase Analytics disabled
2017-06-07 18:07:19.623 son[2909] <Notice> [Firebase/Analytics][I-ACS023013] Firebase Analytics disabled
(我必须在上面的输出中的URL上添加X,以克服stackoverflow的URL缩短器阻止程序.)
(I had to add X to the URLs in the above output to get past stackoverflow's URL shortener blocker.)
我尝试在Info.plist中将FIREBASE_ANALYTICS_COLLECTION_DEACTIVATED设置为YES,删除了2行,但又增加了2行以告诉我Analytics(分析)已禁用(FFS!).
I tried setting FIREBASE_ANALYTICS_COLLECTION_DEACTIVATED to YES in my Info.plist, that removed 2 lines, but added another 2 lines to tell me that Analytics is disabled (FFS!).
此垃圾邮件输出使我们的开发人员很难看到任何实际上很重要的控制台输出.如何禁用它?
This spammed output makes it difficult for our developers to see any console output that is actually important. How can I disable it?
(否则,我们将非常欢迎提出有关如何仅输出每行一次的建议.)
(Failing that, a suggestion on how to get it outputting each line only once would be really welcome.)
推荐答案
据我所知,以下两行:
[[FIRConfiguration sharedInstance] setLoggerLevel:FIRLoggerLevelMin];
[[FIRAnalyticsConfiguration sharedInstance] setAnalyticsCollectionEnabled:NO];
放置在应用程序委托的didFinishLaunchingWithOptions:
中非常早的位置将完全禁用FireBase分析,包括停止所有控制台输出.
placed very early in the app delegate's didFinishLaunchingWithOptions:
will completely disable FireBase analytics, including stopping all the console output.
此后,我还发现不推荐使用Google/SignIn
cocoapod-建议使用的是GoogleSignIn
(即没有'/').如果您使用GoogleSignIn
,则它不依赖Firebase Analytics,因此原来的问题就消失了.现在,我的应用程序中支持Google云端硬盘,并且没有Firebase Analytics!
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!
这篇关于完全禁用Firebase/Analytics(分析)以在应用程序启动时停止控制台垃圾邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!