0

My logcat files are getting filled with garbage from some bluetooth sytem classes and similar, so I wanted to add a regex filter. The filter works fine in the logcat window in Android Studio, but I cant get it to work when outputing the log to file.

This is what I got.

Process process = Runtime.getRuntime().exec("logcat -c");
process = Runtime.getRuntime().exec("logcat -f " + logFile + " -r 15000 -n 7 --regex=\"^(?!.*(BluetoothAdapter|BluetoothLeScanner|SurfaceView)).*$\" ");

I've tried both -e and --regex= according to the documentation. I also tried with and without dubble-quotes. With the dubble-quotes, the logfiles don't get any new entries, but I cannot find any error related to the initialization (not sure what to look for either).

0 Answers0