-
Notifications
You must be signed in to change notification settings - Fork 106
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updated crashlytics; added some non-fatal exceptions logging
- Loading branch information
Showing
6 changed files
with
35 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
app/src/main/java/com/phlox/tvwebbrowser/utils/LogUtils.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package com.phlox.tvwebbrowser.utils | ||
|
||
object LogUtils { | ||
//send exception info to crashlytics in case crashlytics included in current build | ||
fun recordException(e: Throwable) { | ||
try { | ||
val clazz = Class.forName("com.google.firebase.crashlytics.FirebaseCrashlytics") | ||
val method = clazz.getMethod("getInstance") | ||
val crashlytics = method.invoke(null) | ||
val clazz2 = crashlytics::class.java | ||
val method2 = clazz2.getMethod("recordException", Throwable::class.java) | ||
method2.invoke(crashlytics, e) | ||
} catch (ex: ClassNotFoundException) { | ||
//thats ok - not all builds include crashlytics | ||
} catch (ex: Exception) { | ||
ex.printStackTrace() | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters