Is there a way to filter StrictMode violations based on durations?
It's getting a bit annoying having these
StrictMode policy violation; ~duration=6 ms: android.os.StrictMode$StrictModeDiskWriteViolation: policy=31 violation=1
poisoning my logcat. I think StrictMode is an useful feature, but I'd like to deal only with violations with a duration greater than, let's say, 50 ms, in the first development phase.
Thanks
The StrictMode API does not support filtering by duration.
But you can easily do so by filtering StrictMode's log reports:
A. Configure StrictMode to write errors to log:
B. Read logcat lines:
C. filter lines by duration:
I leave you to figure out the exact details of the line parsing.