Reorder crash logs

to remove the starting new line at each log
This commit is contained in:
Jays2Kings 2022-04-19 22:14:27 -04:00
parent 29621c755a
commit 313120307b

View file

@ -23,8 +23,8 @@ class CrashLogUtil(private val context: Context) {
fun dumpLogs() {
try {
val file = context.createFileInCacheDir("tachiyomi_crash_logs.txt")
Runtime.getRuntime().exec("logcat *:E -d -f ${file.absolutePath}")
file.appendText(getDebugInfo())
Runtime.getRuntime().exec("logcat *:E -d -f ${file.absolutePath}")
showNotification(file.getUriCompat(context))
} catch (e: IOException) {
@ -33,7 +33,6 @@ class CrashLogUtil(private val context: Context) {
}
fun getDebugInfo(): String {
return """
App version: ${BuildConfig.VERSION_NAME} (${BuildConfig.FLAVOR}, ${BuildConfig.COMMIT_SHA}, ${BuildConfig.VERSION_CODE}, ${BuildConfig.BUILD_TIME})
Android version: ${Build.VERSION.RELEASE} (SDK ${Build.VERSION.SDK_INT})
Android build ID: ${Build.DISPLAY}
@ -42,6 +41,7 @@ class CrashLogUtil(private val context: Context) {
Device name: ${Build.DEVICE}
Device model: ${Build.MODEL}
Device product name: ${Build.PRODUCT}
""".trimIndent()
}
private fun showNotification(uri: Uri) {