mirror of
https://github.com/bitwarden/android.git
synced 2024-10-31 07:05:35 +03:00
Add ability to log non-fatal errors (#3417)
This commit is contained in:
parent
adf7916a4c
commit
65237c18d7
3 changed files with 13 additions and 0 deletions
|
@ -11,4 +11,6 @@ class CrashLogsManagerImpl(
|
|||
legacyAppCenterMigrator: LegacyAppCenterMigrator,
|
||||
) : CrashLogsManager {
|
||||
override var isEnabled: Boolean = true
|
||||
|
||||
override fun trackNonFatalException(e: Exception) = Unit
|
||||
}
|
||||
|
|
|
@ -9,4 +9,9 @@ interface CrashLogsManager {
|
|||
* Gets or sets whether the collection of crash logs is enabled.
|
||||
*/
|
||||
var isEnabled: Boolean
|
||||
|
||||
/**
|
||||
* Tracks an exception if logs are enabled.
|
||||
*/
|
||||
fun trackNonFatalException(e: Exception)
|
||||
}
|
||||
|
|
|
@ -22,6 +22,12 @@ class CrashLogsManagerImpl(
|
|||
Firebase.crashlytics.setCrashlyticsCollectionEnabled(value)
|
||||
}
|
||||
|
||||
override fun trackNonFatalException(e: Exception) {
|
||||
if (settingsRepository.isCrashLoggingEnabled) {
|
||||
Firebase.crashlytics.recordException(e)
|
||||
}
|
||||
}
|
||||
|
||||
init {
|
||||
legacyAppCenterMigrator.migrateIfNecessary()
|
||||
isEnabled = settingsRepository.isCrashLoggingEnabled
|
||||
|
|
Loading…
Reference in a new issue