1
0
Fork 0
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:
Evgenii Kozlov 2023-05-17 18:41:42 +02:00 committed by uburoiubu
parent 492b657c45
commit 9ef07124ba
No known key found for this signature in database
GPG key ID: C8FB80E0A595FBB6
8 changed files with 35 additions and 74 deletions

View file

@ -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')
}

View file

@ -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
)
)
}
}
}
}
}