I have patched the LogCat collector to only include logcat entries that were created by my own PID. This is a hack, the matching should be for the string "PID):", and not only for the number, but I just wanted to get this out there before it sinks back into my pile of code :)
You will probably get less lines of logcat output than you requested, I request 400 lines and get about 200 - but only lines concerning my app. This alleviates privacy issues and requires less bandwidth/space.
Hope this helps. Thanks again for this excellent library.
Index: acra/collector/LogCatCollector.java
===================================================================
--- acra/collector/LogCatCollector.java (revision 772)
+++ acra/collector/LogCatCollector.java (working copy)
@@ -58,6 +58,11 @@
* plan consumption.
*/
public static String collectLogCat(String bufferName) {
+ final int myPid = android.os.Process.myPid();
+ String myPidStr = null;
+ if (myPid > 0) {
+ myPidStr = Integer.toString(myPid);
+ }
final List<String> commandLine = new ArrayList<String>();
commandLine.add("logcat");
@@ -96,7 +101,9 @@
if (line == null) {
break;
}
- logcatBuf.add(line + "\n");
+ if (myPidStr == null || line.contains(myPidStr)) {
+ logcatBuf.add(line + "\n");
+ }
}
} catch (IOException e) {