简体   繁体   中英

Change the loglevel of GoogleTagManager v5 on iOS

I've integrated GoogleTagManager v5 in an iOS project. It's working fine, but now I see these logmessages in the Xcode console:

2017-07-14 09:09:19.285 App[23194:15302685] GoogleTagManager info: Loading container: GTM-XXX
2017-07-14 09:09:19.286 App[23194:15302665] GoogleTagManager info: Attempting to load saved version of container GTM-XXX
2017-07-14 09:09:19.310 App[23194:15302665] GoogleTagManager info: Processing logged event: gtm.load with parameters: (null)
2017-07-14 09:09:19.324 App[23194:15302665] GoogleTagManager info: Sending universal analytics hit: {
    "&t" = screenview;
    "&tid" = "UA-000000-1";
}
[...]

To reduce the amount of clutter in my console would like to change the loglevel for GoogleTagManager to warnings and errors only, but I can't find how to do this?

I've tried:

  • Setting GAI.sharedInstance().logger.logLevel but that doesn't have effect on these logs.
  • Setting FirebaseConfiguration.shared.setLoggerLevel does silence Firebase logs, but not these GoogleTagManager logs.
  • Passing the -FIRAnalyticsDebugDisabled argument also doesn't have effect on GoogleTagManager logs.
  • Searched for pointers in the GoogleTagManager.h file, but there only seems to be one protocol in the TagManager CocoaPod since v5. So no logging options there.

Any ideas on how to change the Google Tag Manager log level or how to disable logging entirely?

我能找到的唯一答案是一个黑暗的魔法与调整: https ://stackoverflow.com/a/45411324/1016656

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM