зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1248459 - Get more logs for debugging crash; r=snorp
This patch turns on logging for GeckoEditable and GeckoInputConnection, and makes us fetch more lines of logcat when submitting crash reports.
This commit is contained in:
Родитель
48144b598c
Коммит
a44d38701c
|
@ -314,15 +314,20 @@ public class CrashReporter extends AppCompatActivity
|
|||
}
|
||||
|
||||
private String readLogcat() {
|
||||
final String crashReporterProc = " " + android.os.Process.myPid() + ' ';
|
||||
BufferedReader br = null;
|
||||
try {
|
||||
// get the last 200 lines of logcat
|
||||
// get at most the last 400 lines of logcat
|
||||
Process proc = Runtime.getRuntime().exec(new String[] {
|
||||
"logcat", "-v", "threadtime", "-t", "200", "-d", "*:D"
|
||||
"logcat", "-v", "threadtime", "-t", "400", "-d", "*:D"
|
||||
});
|
||||
StringBuilder sb = new StringBuilder();
|
||||
br = new BufferedReader(new InputStreamReader(proc.getInputStream()));
|
||||
for (String s = br.readLine(); s != null; s = br.readLine()) {
|
||||
if (s.contains(crashReporterProc)) {
|
||||
// Don't include logs from the crash reporter's process.
|
||||
break;
|
||||
}
|
||||
sb.append(s).append('\n');
|
||||
}
|
||||
return sb.toString();
|
||||
|
|
|
@ -49,7 +49,8 @@ final class GeckoEditable extends JNIObject
|
|||
implements InvocationHandler, Editable,
|
||||
GeckoEditableClient, GeckoEditableListener, GeckoEventListener {
|
||||
|
||||
private static final boolean DEBUG = false;
|
||||
// Turned on temporarily for debugging bug 1248459.
|
||||
private static final boolean DEBUG = !AppConstants.RELEASE_BUILD;
|
||||
private static final String LOGTAG = "GeckoEditable";
|
||||
|
||||
// Filters to implement Editable's filtering functionality
|
||||
|
|
|
@ -43,7 +43,8 @@ class GeckoInputConnection
|
|||
extends BaseInputConnection
|
||||
implements InputConnectionListener, GeckoEditableListener {
|
||||
|
||||
private static final boolean DEBUG = false;
|
||||
// Turned on temporarily for debugging bug 1248459.
|
||||
private static final boolean DEBUG = !AppConstants.RELEASE_BUILD;
|
||||
protected static final String LOGTAG = "GeckoInputConnection";
|
||||
|
||||
private static final String CUSTOM_HANDLER_TEST_METHOD = "testInputConnection";
|
||||
|
|
Загрузка…
Ссылка в новой задаче