feat: special UE handler
This commit is contained in:
parent
4fc96b77e3
commit
69fb86d015
1 changed files with 12 additions and 1 deletions
|
@ -117,6 +117,17 @@ object Logger {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun uncaughtException(t: Thread, e: Throwable) {
|
||||||
|
loggerExecutor.execute {
|
||||||
|
if (file == null) e.printStackTrace() else {
|
||||||
|
file?.appendText("---------------------------Uncaught Exception---------------------------\n")
|
||||||
|
file?.appendText("thread: ${t.name}\n")
|
||||||
|
file?.appendText("date/time: ${Date()} | ${e.message}\n")
|
||||||
|
file?.appendText("trace: ${e.stackTraceToString()}\n")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fun shareLog(context: Context) {
|
fun shareLog(context: Context) {
|
||||||
if (file == null) {
|
if (file == null) {
|
||||||
snackString("No log file found")
|
snackString("No log file found")
|
||||||
|
@ -151,7 +162,7 @@ class FinalExceptionHandler : Thread.UncaughtExceptionHandler {
|
||||||
Thread.getDefaultUncaughtExceptionHandler()
|
Thread.getDefaultUncaughtExceptionHandler()
|
||||||
|
|
||||||
override fun uncaughtException(t: Thread, e: Throwable) {
|
override fun uncaughtException(t: Thread, e: Throwable) {
|
||||||
Logger.log(e)
|
Logger.uncaughtException(t, e)
|
||||||
Injekt.get<CrashlyticsInterface>().logException(e)
|
Injekt.get<CrashlyticsInterface>().logException(e)
|
||||||
defaultUEH?.uncaughtException(t, e)
|
defaultUEH?.uncaughtException(t, e)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue