Add zoned "Current time" to debug info and include year & timezone in logcat output (#1672)
* Add zoned date & time to debug info & logs This should help distinguish log entries that happened recently and may be related to crashes from older entries that occurred before now. * Change logcat date and time output format After some discussion, it was decided to adjust the logcat date and time display to include the year and the timezone in the logcat output. This results in a line start like this: `2025-01-27 18:37:46.662 +0100` which follows the following DateTimeFormatter pattern: `yyyy-MM-dd HH:mm:ss.SSS Z` * Add CHANGELOG.md entry (cherry picked from commit 503d0be66772c37e08e69e5d022475245b706fd1) # Conflicts: # CHANGELOG.md
This commit is contained in:
parent
fda27e6eba
commit
b34f807d33
@ -14,6 +14,8 @@ import tachiyomi.core.common.util.lang.withNonCancellableContext
|
|||||||
import tachiyomi.core.common.util.lang.withUIContext
|
import tachiyomi.core.common.util.lang.withUIContext
|
||||||
import uy.kohesive.injekt.Injekt
|
import uy.kohesive.injekt.Injekt
|
||||||
import uy.kohesive.injekt.api.get
|
import uy.kohesive.injekt.api.get
|
||||||
|
import java.time.OffsetDateTime
|
||||||
|
import java.time.ZoneId
|
||||||
|
|
||||||
class CrashLogUtil(
|
class CrashLogUtil(
|
||||||
private val context: Context,
|
private val context: Context,
|
||||||
@ -28,7 +30,7 @@ class CrashLogUtil(
|
|||||||
getExtensionsInfo()?.let { file.appendText("$it\n\n") }
|
getExtensionsInfo()?.let { file.appendText("$it\n\n") }
|
||||||
exception?.let { file.appendText("$it\n\n") }
|
exception?.let { file.appendText("$it\n\n") }
|
||||||
|
|
||||||
Runtime.getRuntime().exec("logcat *:E -d -f ${file.absolutePath}").waitFor()
|
Runtime.getRuntime().exec("logcat *:E -d -v year -v zone -f ${file.absolutePath}").waitFor()
|
||||||
|
|
||||||
val uri = file.getUriCompat(context)
|
val uri = file.getUriCompat(context)
|
||||||
context.startActivity(uri.toShareIntent(context, "text/plain"))
|
context.startActivity(uri.toShareIntent(context, "text/plain"))
|
||||||
@ -47,6 +49,7 @@ class CrashLogUtil(
|
|||||||
Device name: ${Build.DEVICE} (${Build.PRODUCT})
|
Device name: ${Build.DEVICE} (${Build.PRODUCT})
|
||||||
Device model: ${Build.MODEL}
|
Device model: ${Build.MODEL}
|
||||||
WebView: ${WebViewUtil.getVersion(context)}
|
WebView: ${WebViewUtil.getVersion(context)}
|
||||||
|
Current time: ${OffsetDateTime.now(ZoneId.systemDefault())}
|
||||||
""".trimIndent()
|
""".trimIndent()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user