summaryrefslogtreecommitdiffhomepage
path: root/android/app/src
diff options
context:
space:
mode:
authorAlbin <albin@mullvad.net>2024-06-25 16:46:31 +0200
committerAlbin <albin@mullvad.net>2024-06-26 12:59:29 +0200
commitcee8176be4cae9cc605cca5ffae85d243adc4f3a (patch)
treed989a1aa16b26b1245c65f849b6f1f03e14faba0 /android/app/src
parent0316f672c58f5558ce9880af698098c3718591b6 (diff)
downloadmullvadvpn-cee8176be4cae9cc605cca5ffae85d243adc4f3a.tar.xz
mullvadvpn-cee8176be4cae9cc605cca5ffae85d243adc4f3a.zip
Migrate log calls to kermit
Diffstat (limited to 'android/app/src')
-rw-r--r--android/app/src/main/kotlin/net/mullvad/mullvadvpn/MullvadApplication.kt5
-rw-r--r--android/app/src/main/kotlin/net/mullvad/mullvadvpn/util/ChangelogDataProvider.kt4
-rw-r--r--android/app/src/main/kotlin/net/mullvad/mullvadvpn/viewmodel/VpnSettingsViewModel.kt4
3 files changed, 8 insertions, 5 deletions
diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/MullvadApplication.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/MullvadApplication.kt
index 04ccb1cddc..e94f2edb09 100644
--- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/MullvadApplication.kt
+++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/MullvadApplication.kt
@@ -1,11 +1,14 @@
package net.mullvad.mullvadvpn
import android.app.Application
+import co.touchlab.kermit.Logger
import net.mullvad.mullvadvpn.di.appModule
import org.koin.android.ext.koin.androidContext
import org.koin.core.context.loadKoinModules
import org.koin.core.context.startKoin
+private const val LOG_TAG = "mullvad"
+
/**
* In Android, separate instances of the application class (MullvadApplication) will be instantiated
* for each process. That also means that a only common logic should be placed here.
@@ -13,7 +16,7 @@ import org.koin.core.context.startKoin
class MullvadApplication : Application() {
override fun onCreate() {
super.onCreate()
- // Used to create/start separate DI graphs for each process. Avoid non-common classes etc.
+ Logger.setTag(LOG_TAG)
startKoin { androidContext(this@MullvadApplication) }
loadKoinModules(listOf(appModule))
}
diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/util/ChangelogDataProvider.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/util/ChangelogDataProvider.kt
index c1dc72ebfe..d4e3957f94 100644
--- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/util/ChangelogDataProvider.kt
+++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/util/ChangelogDataProvider.kt
@@ -1,7 +1,7 @@
package net.mullvad.mullvadvpn.util
import android.content.res.AssetManager
-import android.util.Log
+import co.touchlab.kermit.Logger
import java.io.IOException
private const val CHANGELOG_FILE = "en-US/default.txt"
@@ -12,7 +12,7 @@ class ChangelogDataProvider(private var assets: AssetManager) : IChangelogDataPr
return try {
assets.open(CHANGELOG_FILE).bufferedReader().use { it.readText() }
} catch (ex: IOException) {
- Log.e("mullvad", "Unable to read bundled changelog file.")
+ Logger.e("Unable to read bundled changelog file.")
EMPTY_DEFAULT_STRING_WHEN_UNABLE_TO_READ_CHANGELOG
}
}
diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/viewmodel/VpnSettingsViewModel.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/viewmodel/VpnSettingsViewModel.kt
index 3c24cba6d6..1e9a335951 100644
--- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/viewmodel/VpnSettingsViewModel.kt
+++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/viewmodel/VpnSettingsViewModel.kt
@@ -1,8 +1,8 @@
package net.mullvad.mullvadvpn.viewmodel
-import android.util.Log
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
+import co.touchlab.kermit.Logger
import java.net.InetAddress
import java.net.UnknownHostException
import kotlinx.coroutines.CoroutineDispatcher
@@ -259,7 +259,7 @@ class VpnSettingsViewModel(
return try {
map { InetAddress.getByName(it) }
} catch (ex: UnknownHostException) {
- Log.e("mullvad", "Error parsing the DNS address list.")
+ Logger.e("Error parsing the DNS address list.")
emptyList()
}
}