diff --git a/core/logging/config/build.gradle.kts b/core/logging/config/build.gradle.kts deleted file mode 100644 index a73c997a1ee..00000000000 --- a/core/logging/config/build.gradle.kts +++ /dev/null @@ -1,17 +0,0 @@ -plugins { - id(ThunderbirdPlugins.Library.kmp) -} - -android { - namespace = "net.thunderbird.core.logging.config" -} - -kotlin { - sourceSets { - commonMain.dependencies { - api(projects.core.logging.api) - implementation(projects.core.logging.implComposite) - implementation(projects.core.logging.implFile) - } - } -} diff --git a/core/logging/config/src/commonMain/kotlin/net/thunderbird/core/logging/config/DebugLogConfigurator.kt b/core/logging/impl-legacy/src/androidMain/kotlin/net/thunderbird/core/logging/legacy/DebugLogConfigurator.kt similarity index 71% rename from core/logging/config/src/commonMain/kotlin/net/thunderbird/core/logging/config/DebugLogConfigurator.kt rename to core/logging/impl-legacy/src/androidMain/kotlin/net/thunderbird/core/logging/legacy/DebugLogConfigurator.kt index 2fb6c5d9903..2e8c63df314 100644 --- a/core/logging/config/src/commonMain/kotlin/net/thunderbird/core/logging/config/DebugLogConfigurator.kt +++ b/core/logging/impl-legacy/src/androidMain/kotlin/net/thunderbird/core/logging/legacy/DebugLogConfigurator.kt @@ -1,17 +1,19 @@ -package net.thunderbird.core.logging.config +package net.thunderbird.core.logging.legacy import net.thunderbird.core.logging.composite.CompositeLogSink import net.thunderbird.core.logging.file.FileLogSink +import timber.log.Timber +import timber.log.Timber.DebugTree +// TODO: Implementation https://github.com/thunderbird/thunderbird-android/issues/9573 class DebugLogConfigurator( private val syncDebugCompositeSink: CompositeLogSink, private val syncDebugFileLogSink: FileLogSink, ) { fun updateLoggingStatus(isDebugLoggingEnabled: Boolean) { - syncDebugCompositeSink.manager.removeAll() + Timber.uprootAll() if (isDebugLoggingEnabled) { - syncDebugCompositeSink.manager.add(syncDebugCompositeSink) - syncDebugCompositeSink.manager.add(syncDebugFileLogSink) + Timber.plant(DebugTree()) } } diff --git a/legacy/core/build.gradle.kts b/legacy/core/build.gradle.kts index 94f3e6ee3c2..a9d4f9f1cd8 100644 --- a/legacy/core/build.gradle.kts +++ b/legacy/core/build.gradle.kts @@ -13,7 +13,6 @@ dependencies { api(projects.core.preference.impl) api(projects.core.android.logging) api(projects.core.logging.implFile) - api(projects.core.logging.config) api(projects.core.logging.implComposite) api(projects.core.android.network) api(projects.core.outcome) diff --git a/legacy/core/src/main/java/com/fsck/k9/preferences/DefaultGeneralSettingsManager.kt b/legacy/core/src/main/java/com/fsck/k9/preferences/DefaultGeneralSettingsManager.kt index a8fc6c6791d..c8a20f61eea 100644 --- a/legacy/core/src/main/java/com/fsck/k9/preferences/DefaultGeneralSettingsManager.kt +++ b/legacy/core/src/main/java/com/fsck/k9/preferences/DefaultGeneralSettingsManager.kt @@ -13,7 +13,7 @@ import kotlinx.coroutines.flow.stateIn import kotlinx.coroutines.launch import kotlinx.coroutines.sync.Mutex import kotlinx.coroutines.sync.withLock -import net.thunderbird.core.logging.config.DebugLogConfigurator +import net.thunderbird.core.logging.legacy.DebugLogConfigurator import net.thunderbird.core.preference.GeneralSettings import net.thunderbird.core.preference.GeneralSettingsManager import net.thunderbird.core.preference.PreferenceChangePublisher diff --git a/legacy/core/src/main/java/com/fsck/k9/preferences/KoinModule.kt b/legacy/core/src/main/java/com/fsck/k9/preferences/KoinModule.kt index c34de9df94a..d9662b4fd17 100644 --- a/legacy/core/src/main/java/com/fsck/k9/preferences/KoinModule.kt +++ b/legacy/core/src/main/java/com/fsck/k9/preferences/KoinModule.kt @@ -3,7 +3,7 @@ package com.fsck.k9.preferences import com.fsck.k9.Preferences import kotlin.time.ExperimentalTime import net.thunderbird.core.android.account.LegacyAccountDtoManager -import net.thunderbird.core.logging.config.DebugLogConfigurator +import net.thunderbird.core.logging.legacy.DebugLogConfigurator import net.thunderbird.core.preference.DefaultPreferenceChangeBroker import net.thunderbird.core.preference.GeneralSettingsManager import net.thunderbird.core.preference.PreferenceChangeBroker diff --git a/quality/konsist/src/test/kotlin/net/thunderbird/quality/ValidateLogger.kt b/quality/konsist/src/test/kotlin/net/thunderbird/quality/ValidateLogger.kt index 8b36893f985..9e152bd05ef 100644 --- a/quality/konsist/src/test/kotlin/net/thunderbird/quality/ValidateLogger.kt +++ b/quality/konsist/src/test/kotlin/net/thunderbird/quality/ValidateLogger.kt @@ -30,7 +30,7 @@ class ValidateLogger { .filterNot { it.hasNameMatching("ConsoleLogSink.android|ConsoleLogSinkTest.android".toRegex()) } .filterNot { // Exclude legacy code that still uses Timber - it.hasNameMatching("LogFileWriter|FileLoggerTree|K9".toRegex()) + it.hasNameMatching("LogFileWriter|FileLoggerTree|K9|DebugLogConfigurator".toRegex()) } .assertFalse( additionalMessage = "No class should use timber.log.Timber import, use net.thunderbird.core.logging.Logger instead." diff --git a/settings.gradle.kts b/settings.gradle.kts index f68ddd3cc85..35fb8a7bd7c 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -153,7 +153,6 @@ include( ":core:configstore:impl-backend", ":core:featureflag", ":core:logging:api", - ":core:logging:config", ":core:logging:impl-composite", ":core:logging:impl-console", ":core:logging:impl-legacy",