xcode 禁用 Google App Measurement 调试日志记录

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/34652141/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 08:23:26  来源:igfitidea点击:

Disable Google App Measurement debug logging

xcodedebugging

提问by Nahouto

On Xcode 7.2, how can I disable these debug/app measurements intempestive displays :

在 Xcode 7.2 上,如何禁用这些调试/应用程序测量的无节制显示:

2016-01-07 11:52:53.085 MyApp[1457:] <GMR/INFO> App measurement v.1302000 started
2016-01-07 11:52:53.091 MyApp[1457:] <GMR/INFO> To enable debug logging set the following application argument: -GMRDebugEnabled (see http://goo.gl/Y0Yjwu)
2016-01-07 11:52:53.091 MyApp[1457:] <GMR/DEBUG> Debug logging enabled
2016-01-07 11:52:53.092 MyApp[1457:] <GMR/DEBUG> App measurement is monitoring the network status
2016-01-07 11:52:53.188 MyApp[1457:] <GMR/DEBUG> App measurement is ready to receive events
2016-01-07 11:52:53.201 MyApp[1457:] <GMR/DEBUG> No network. Upload task will not be scheduled
2016-01-07 11:52:53.202 MyApp[1457:] <GMR/DEBUG> Scheduling user engagement timer
2016-01-07 11:52:53.202 MyApp[1457:] <GMR/DEBUG> Timer scheduled to fire in approx. (s): 3600
2016-01-07 11:52:53.203 MyApp[1457:] <GMR/INFO> App measurement enabled
2016-01-07 11:52:53.237 MyApp[1457:] <GMR/DEBUG> Scheduling user engagement timer
2016-01-07 11:52:53.242 MyApp[1457:] <GMR/DEBUG> Canceling active timer
2016-01-07 11:52:53.245 MyApp[1457:] <GMR/DEBUG> Timer scheduled to fire in approx. (s): 3600
2016-01-07 11:52:53.270 MyApp[1457:] <GMR/DEBUG> Network status has changed. code, status: 3, Connected
2016-01-07 11:52:53.272 MyApp[1457:] <GMR/DEBUG> Timer scheduled to fire in approx. (s): 1614.930058836937
2016-01-07 11:52:53.272 MyApp[1457:] <GMR/DEBUG> Upload task scheduled to be executed in approx. (s): 1614.930058836937

It bothers me since a while...

它困扰了我一段时间......

Thanks !

谢谢 !

Edit : I tried the -noGMRDebugEnabledflag, reinstalling the app without -GMRDebugEnabled, reset Content and settings, restarting Xcode ... nothing works :-(

编辑:我尝试了 -noGMRDebugEnabled标志,在没有 - 的情况下重新安装应用程序GMRDebugEnabled,重置内容和设置,重新启动 Xcode ......没有任何效果:-(

enter image description here

enter image description here

采纳答案by Nahouto

Finally, I found it in the Google API docs.

最后,我在Google API docs 中找到了它。

In the GoogleService-Info.plist file, you have to add a key named IS_MEASUREMENT_ENABLED, set it as a boolean, and select NO value. This will disable App measurement feature and display in the console :

在 GoogleService-Info.plist 文件中,您必须添加一个名为 的键IS_MEASUREMENT_ENABLED,将其设置为布尔值,并选择 NO value。这将禁用应用测量功能并显示在控制台中:

2016-07-03 10:51:38.522 MyApp[313:] <GMR/INFO> App measurement disabled

Thanks for all your answers !

感谢您的所有回答!

回答by Laurent LK

In Swift to disable the Google Measurements I've added in the UIApplicationDelegate launch :

在 Swift 中禁用我在 UIApplicationDelegate 启动中添加的 Google 测量:

GMRConfiguration.sharedInstance().setIsEnabled(false)

回答by Guilherme Puglia

To remove the debug mode, you can delete the UserDefault entry using the following call (you only need to run it once):

要删除调试模式,您可以使用以下调用删除 UserDefault 条目(您只需要运行一次):

[[NSUserDefaults standardUserDefaults] removeObjectForKey:@"/google/measurement/debug_mode"];

[[NSUserDefaults standardUserDefaults] removeObjectForKey:@"/google/measurement/debug_mode"];