1

In my app I want to turn off all logs from Google Analytics in my release build. I'm constantly seeing logs like the following:

Hit delivery requested: ...specifics...
Hit sent to the device AnalyticsService for delivery

I've tried setting the logger to null, I've tried setting the log level to only errors. Any suggestions would be very helpful. Here's my initialization code.

boolean useAnalytics = MyApp.getBuildType().shouldUseAnalytics();
GoogleAnalytics ga = GoogleAnalytics.getInstance(mContext);
ga.setDryRun(!useAnalytics);
if (useAnalytics) {
    ga.setLogger(null);
} else {
    ga.getLogger().setLogLevel(Logger.LogLevel.VERBOSE);
}
tracker = ga.newTracker(mContext.getString(R.string.ga_app_trackerid));
tracker.enableAdvertisingIdCollection(true);
tracker.enableAutoActivityTracking(false);
tracker.setSessionTimeout(300);
Sababado
  • 2,524
  • 5
  • 33
  • 51

1 Answers1

0

There is an answer about disabling logging of third party libraries using pro-guard here

Community
  • 1
  • 1
hasan
  • 23,815
  • 10
  • 63
  • 101