From da95924224261092382da05f3fbcfabeb0794bb7 Mon Sep 17 00:00:00 2001 From: OwenMcGirr Date: Mon, 4 Nov 2024 19:01:30 +0000 Subject: [PATCH] Add Logger closes #753 --- .../enaboapps/switchify/activities/MainActivity.kt | 3 +++ .../java/com/enaboapps/switchify/utils/Logger.kt | 13 +++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 app/src/main/java/com/enaboapps/switchify/utils/Logger.kt diff --git a/app/src/main/java/com/enaboapps/switchify/activities/MainActivity.kt b/app/src/main/java/com/enaboapps/switchify/activities/MainActivity.kt index 0ddb5856..1d437844 100644 --- a/app/src/main/java/com/enaboapps/switchify/activities/MainActivity.kt +++ b/app/src/main/java/com/enaboapps/switchify/activities/MainActivity.kt @@ -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 @@ -17,6 +18,8 @@ class MainActivity : ComponentActivity() { super.onCreate(savedInstanceState) initializeManagers() + Logger.log(this, "Launched Switchify") + setContent { val navController = rememberNavController() diff --git a/app/src/main/java/com/enaboapps/switchify/utils/Logger.kt b/app/src/main/java/com/enaboapps/switchify/utils/Logger.kt new file mode 100644 index 00000000..fa4a3f9d --- /dev/null +++ b/app/src/main/java/com/enaboapps/switchify/utils/Logger.kt @@ -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) + } + } +} \ No newline at end of file