Skip to content

Commit

Permalink
Add Logger
Browse files Browse the repository at this point in the history
closes #753
  • Loading branch information
OwenMcGirr committed Nov 4, 2024
1 parent 3762fad commit da95924
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import com.enaboapps.switchify.activities.ui.theme.SwitchifyTheme
import com.enaboapps.switchify.nav.NavGraph
import com.enaboapps.switchify.preferences.PreferenceManager
import com.enaboapps.switchify.service.custom.actions.store.ActionStore
import com.enaboapps.switchify.utils.Logger

class MainActivity : ComponentActivity() {
private lateinit var preferenceManager: PreferenceManager
Expand All @@ -17,6 +18,8 @@ class MainActivity : ComponentActivity() {
super.onCreate(savedInstanceState)
initializeManagers()

Logger.log(this, "Launched Switchify")

setContent {
val navController = rememberNavController()

Expand Down
13 changes: 13 additions & 0 deletions app/src/main/java/com/enaboapps/switchify/utils/Logger.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.enaboapps.switchify.utils

import android.content.Context
import com.google.firebase.analytics.FirebaseAnalytics

class Logger {
companion object {
fun log(context: Context, message: String) {
FirebaseAnalytics.getInstance(context).logEvent(message, null)
println(message)
}
}
}

0 comments on commit da95924

Please sign in to comment.