Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ProgressBar spamming Logcat

In my application I use a progress bar with a custom drawable. Everything works perfectly fine except that my logcat get spammed with messages every time i call the setProgress(int progress) method of the progress bar.

The messages look like this:

12-09 17:11:54.250 5918-5918/com.mypackage D/ProgressBar﹕ setProgress = 33, fromUser = false 12-09 17:11:54.250 5918-5918/com.mypackage D/ProgressBar﹕ mProgress = 33mIndeterminate = false, mMin = 0, mMax = 100

Those messages are definitely not coming from my code and I haven't found anything related using the search here.

Here's my progressbar in xml:

            <ProgressBar
            android:id="@+id/progress_gpx_simulation"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:max="100"
            android:progress="0"
            android:indeterminate="false"
            style="?android:attr/progressBarStyleHorizontal"
            android:progressDrawable="@drawable/myprogressbar"
            android:layout_marginBottom="5dp" />

And this is how i am accessing it programmatically:

Progressbar progressBarGpxSimulation = (ProgressBar) view.findViewById(R.id.progress_gpx_simulation);
progressBarGpxSimulation.setProgress((int) progress);

Is there any way to turn these messages off? I am updating the progress quite often and can't read my other log messages.

like image 650
Siggy Avatar asked Dec 06 '22 23:12

Siggy


2 Answers

If you're working with Android Studio you can add some filters to your logcat output.

You can use this RegEx to exclude them from the log.

^(?!.*(ProgressBar)).*$
like image 81
axierjhtjz Avatar answered Dec 10 '22 12:12

axierjhtjz


I know it's unsightly and terribly long, but I, like you got annoyed with all of the extra logs when attempting to debug my apps. I build a list of all the problem ones and ignored them like so:

tag:^(?!(MediaPlayer|dalvikvm|Activity|LocSvc|SignalStrength|Wifi|StateMachine|Parcel|CellInfo|qcom_|GpsLocationProvider|wpa_|AlarmManager|Telephony|LocationManager|StatusBar|Vold|PhoneInterface|PhoneGlobals|QCNEJ|SensorManager|NotificationService|SensorService|ThermalEngine|NotificationEventsAdapter|Weather_cast|Notification|NavigationBar|EDL|LGDMClient|NiLS|Tethering|Netd|Gcore|Util|AudioManager|BML))

Add to, remove etc. BANG! And the nonsense is gone!

like image 39
fantasitcalbeast Avatar answered Dec 10 '22 13:12

fantasitcalbeast