mirror of
https://github.com/anyproto/anytype-kotlin.git
synced 2025-06-08 05:47:05 +09:00
DROID-1165 App | Tech | Remove Crashlytics dependency + Setup Timber with Sentry (#3178)
This commit is contained in:
parent
492b657c45
commit
9ef07124ba
8 changed files with 35 additions and 74 deletions
|
@ -1,7 +1,7 @@
|
|||
plugins {
|
||||
id "com.android.library"
|
||||
id "kotlin-android"
|
||||
id "io.sentry.android.gradle" version "3.4.2"
|
||||
id "io.sentry.android.gradle" version "3.6.0"
|
||||
}
|
||||
|
||||
android {
|
||||
|
@ -21,5 +21,6 @@ android {
|
|||
|
||||
dependencies {
|
||||
implementation libs.sentry
|
||||
implementation libs.sentryTimber
|
||||
implementation project(path: ':core-utils')
|
||||
}
|
|
@ -2,19 +2,31 @@ package com.anytypeio.anytype
|
|||
|
||||
import android.content.Context
|
||||
import com.anytypeio.anytype.core_utils.tools.AppInfo
|
||||
import io.sentry.SentryLevel
|
||||
import io.sentry.android.core.SentryAndroid
|
||||
import io.sentry.android.core.SentryAndroidOptions
|
||||
import io.sentry.android.timber.SentryTimberIntegration
|
||||
|
||||
class SentryCrashReporter(
|
||||
context: Context,
|
||||
appInfo: AppInfo
|
||||
private val context: Context,
|
||||
private val appInfo: AppInfo,
|
||||
) {
|
||||
|
||||
init {
|
||||
fun init(
|
||||
withTimber: Boolean
|
||||
) {
|
||||
SentryAndroid.init(context) { options: SentryAndroidOptions ->
|
||||
options.release = appInfo.versionName
|
||||
options.environment = appInfo.sentryEnvironment.value
|
||||
with(options) {
|
||||
release = appInfo.versionName
|
||||
environment = appInfo.sentryEnvironment.value
|
||||
if (withTimber) {
|
||||
addIntegration(
|
||||
SentryTimberIntegration(
|
||||
minEventLevel = SentryLevel.ERROR,
|
||||
minBreadcrumbLevel = SentryLevel.INFO
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue