From 7d8d53d2188683a65cd29439a2acd23ee493ab7c Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Wed, 8 Apr 2020 20:57:23 +0200 Subject: [PATCH] Write crash info in Markdown --- .../danoeh/antennapod/CrashReportWriter.java | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/app/src/main/java/de/danoeh/antennapod/CrashReportWriter.java b/app/src/main/java/de/danoeh/antennapod/CrashReportWriter.java index ab4d564df..b5d0f6945 100644 --- a/app/src/main/java/de/danoeh/antennapod/CrashReportWriter.java +++ b/app/src/main/java/de/danoeh/antennapod/CrashReportWriter.java @@ -35,12 +35,14 @@ public class CrashReportWriter implements Thread.UncaughtExceptionHandler { PrintWriter out = null; try { out = new PrintWriter(new FileWriter(path)); - out.println("[ Crash info ]"); + out.println("## Crash info"); out.println("Time: " + new SimpleDateFormat("dd-MM-yyyy HH:mm:ss", Locale.getDefault()).format(new Date())); out.println("AntennaPod version: " + BuildConfig.VERSION_NAME); out.println(); - out.println("[ StackTrace ]"); + out.println("## StackTrace"); + out.println("```"); ex.printStackTrace(out); + out.println("```"); } catch (IOException e) { Log.e(TAG, Log.getStackTraceString(e)); } finally { @@ -50,12 +52,12 @@ public class CrashReportWriter implements Thread.UncaughtExceptionHandler { } public static String getSystemInfo() { - return "[ Environment ]" + - "\nAndroid version: " + Build.VERSION.RELEASE + - "\nOS version: " + System.getProperty("os.version") + - "\nAntennaPod version: " + BuildConfig.VERSION_NAME + - "\nModel: " + Build.MODEL + - "\nDevice: " + Build.DEVICE + - "\nProduct: " + Build.PRODUCT; + return "## Environment" + + "\nAndroid version: " + Build.VERSION.RELEASE + + "\nOS version: " + System.getProperty("os.version") + + "\nAntennaPod version: " + BuildConfig.VERSION_NAME + + "\nModel: " + Build.MODEL + + "\nDevice: " + Build.DEVICE + + "\nProduct: " + Build.PRODUCT; } }