Turn off Firebase logcat logging
Asked Answered
R

3

39

Now that I have integrated Firebase, I don't want to see logcat spam like this

D/FirebaseCrashApiImpl: FirebaseCrash reporting API initialized
I/FirebaseCrash: FirebaseCrash reporting initialized com.google.firebase.crash.internal.zzg@e9c7537
D/FirebaseApp: Initialized class com.google.firebase.crash.FirebaseCrash.
I/FA: App measurement is starting up, version: 9080
I/FA: To enable debug logging run: adb shell setprop log.tag.FA VERBOSE

I tried running adb shell setprop log.tag.FA ERROR, but it still keeps logging everything.

How do I turn it off in the SDK (or setprop)? Filtering it out of logcat is not the solution I am looking for.

Redintegration answered 1/6, 2016 at 19:55 Comment(1)
First they quietly give you firebase analytics when migrating to FCM from GCM, now you cant even disable the logcats, and when you do, it resets to VERBOSE every app restartBauble
W
16

You can go disable it via command line:

adb shell setprop log.tag.FA SILENT
adb shell setprop log.tag.FA-SVC SILENT
Weightlessness answered 26/7, 2018 at 16:37 Comment(3)
@Ewan firebase.google.com/docs/analytics/android/…Weightlessness
Thanks. Still doesn't work for me - I run the command and then start app. In AS: 02-13 18:49:49.784 7287-7376/uk.co.xxxxxx.debug V/FA: Connecting to remote I can use the regex filter below instead. Strange, though, the command to show debug events works fine for meAustreng
@Austreng are you sure you cleared the logcat-buffer first? Because in the new logcat-view, if I change the filter, I have to re-select the device to update the logcat-buffer, but then, also previous logcat-items from previous tests may show up (I then clear the buffer and try again, this adb-commands fixed it definitely for me with com.google.firebase:firebase-messaging-ktx:23.4.0).Patronymic
C
6

The only way I found is to use the logcat filters in Android Studio to just hide all lines with tag FA.

  1. In the logcat console dropdown on the right side, click Edit Filter Configuration
  2. In Log Tag field (Regex must be checked), enter this: ^(?!(FA))
  3. In the Package Name field, enter your package name

Done!

Chlorothiazide answered 22/5, 2018 at 5:5 Comment(1)
If you want to disable multiple TAGs then use ^(?!(EXCLUDE_TAG1|EXCLUDE_TAG2)) e.g. ^(?!(FA|QueuedMuxer|ACodec|MPEG4Writer))Somnambulism
G
-4

I think you have to disable every package separately. To turn off Firebase Crash Reporting programmatically try this

FirebaseCrash.setCrashCollectionEnabled(!BuildConfig.DEBUG);
Garcia answered 9/1, 2018 at 14:48 Comment(1)
This may stop reporting up to Firebase, but it does not address the logcat spam OP was trying to fix. (I tried this, it had no effect.)Obediah

© 2022 - 2024 — McMap. All rights reserved.