aboutsummaryrefslogtreecommitdiff
path: root/app/src
diff options
context:
space:
mode:
Diffstat (limited to 'app/src')
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/FrostApp.kt13
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/StartActivity.kt3
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/utils/L.kt2
3 files changed, 14 insertions, 4 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/FrostApp.kt b/app/src/main/kotlin/com/pitchedapps/frost/FrostApp.kt
index 4c34ccfc..9cfe5618 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/FrostApp.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/FrostApp.kt
@@ -7,6 +7,9 @@ import android.net.Uri
import android.widget.ImageView
import com.bumptech.glide.Glide
import com.bumptech.glide.request.RequestOptions
+import com.crashlytics.android.Crashlytics
+import com.crashlytics.android.answers.Answers
+import com.crashlytics.android.core.CrashlyticsCore
import com.mikepenz.materialdrawer.util.AbstractDrawerImageLoader
import com.mikepenz.materialdrawer.util.DrawerImageLoader
import com.mikepenz.materialdrawer.util.DrawerUIUtils
@@ -15,17 +18,25 @@ import com.pitchedapps.frost.utils.CrashReportingTree
import com.pitchedapps.frost.utils.Prefs
import com.raizlabs.android.dbflow.config.FlowConfig
import com.raizlabs.android.dbflow.config.FlowManager
+import io.fabric.sdk.android.Fabric
import timber.log.Timber
import timber.log.Timber.DebugTree
+
/**
* Created by Allan Wang on 2017-05-28.
*/
class FrostApp : Application() {
override fun onCreate() {
+ val core = CrashlyticsCore.Builder().disabled(BuildConfig.DEBUG).build()
+ Fabric.with(this, core, Answers())
if (BuildConfig.DEBUG) Timber.plant(DebugTree())
- else Timber.plant(CrashReportingTree())
+ else {
+
+ Fabric.with(this, Crashlytics())
+ Timber.plant(CrashReportingTree())
+ }
FlowManager.init(FlowConfig.Builder(this).build())
Prefs(this)
FbCookie()
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/StartActivity.kt b/app/src/main/kotlin/com/pitchedapps/frost/StartActivity.kt
index 2f81d387..04056043 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/StartActivity.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/StartActivity.kt
@@ -2,11 +2,9 @@ package com.pitchedapps.frost
import android.os.Bundle
import android.support.v7.app.AppCompatActivity
-import com.crashlytics.android.Crashlytics
import com.pitchedapps.frost.dbflow.loadFbCookiesAsync
import com.pitchedapps.frost.utils.L
import com.pitchedapps.frost.utils.launchNewTask
-import io.fabric.sdk.android.Fabric
/**
* Created by Allan Wang on 2017-05-28.
@@ -15,7 +13,6 @@ class StartActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
- Fabric.with(this, Crashlytics())
L.d("Load cookies ${System.currentTimeMillis()}")
loadFbCookiesAsync {
cookies ->
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/utils/L.kt b/app/src/main/kotlin/com/pitchedapps/frost/utils/L.kt
index 2465980d..690f967c 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/utils/L.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/utils/L.kt
@@ -1,6 +1,7 @@
package com.pitchedapps.frost.utils
import android.util.Log
+import com.crashlytics.android.Crashlytics
import timber.log.Timber
@@ -20,6 +21,7 @@ internal class CrashReportingTree : Timber.Tree() {
if (priority == Log.VERBOSE || priority == Log.DEBUG)
return
Log.println(priority, tag, message)
+ Crashlytics.log(priority, tag, message)
// FakeCrashLibrary.log(priority, tag, message)
// if (t != null) {