Skip to content

Commit b60ace2

Browse files
Merge pull request #9859 from thunderbird/revert-9816-fix-issue-9573
Revert "Decouple DebugLogConfigurator From Timber And Relocate to New Logger Infra"
2 parents 315b898 + efdde27 commit b60ace2

File tree

7 files changed

+9
-26
lines changed

7 files changed

+9
-26
lines changed

core/logging/config/build.gradle.kts

Lines changed: 0 additions & 17 deletions
This file was deleted.

core/logging/config/src/commonMain/kotlin/net/thunderbird/core/logging/config/DebugLogConfigurator.kt renamed to core/logging/impl-legacy/src/androidMain/kotlin/net/thunderbird/core/logging/legacy/DebugLogConfigurator.kt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
1-
package net.thunderbird.core.logging.config
1+
package net.thunderbird.core.logging.legacy
22

33
import net.thunderbird.core.logging.composite.CompositeLogSink
44
import net.thunderbird.core.logging.file.FileLogSink
5+
import timber.log.Timber
6+
import timber.log.Timber.DebugTree
57

8+
// TODO: Implementation https://github.com/thunderbird/thunderbird-android/issues/9573
69
class DebugLogConfigurator(
710
private val syncDebugCompositeSink: CompositeLogSink,
811
private val syncDebugFileLogSink: FileLogSink,
912
) {
1013
fun updateLoggingStatus(isDebugLoggingEnabled: Boolean) {
11-
syncDebugCompositeSink.manager.removeAll()
14+
Timber.uprootAll()
1215
if (isDebugLoggingEnabled) {
13-
syncDebugCompositeSink.manager.add(syncDebugCompositeSink)
14-
syncDebugCompositeSink.manager.add(syncDebugFileLogSink)
16+
Timber.plant(DebugTree())
1517
}
1618
}
1719

legacy/core/build.gradle.kts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ dependencies {
1313
api(projects.core.preference.impl)
1414
api(projects.core.android.logging)
1515
api(projects.core.logging.implFile)
16-
api(projects.core.logging.config)
1716
api(projects.core.logging.implComposite)
1817
api(projects.core.android.network)
1918
api(projects.core.outcome)

legacy/core/src/main/java/com/fsck/k9/preferences/DefaultGeneralSettingsManager.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import kotlinx.coroutines.flow.stateIn
1313
import kotlinx.coroutines.launch
1414
import kotlinx.coroutines.sync.Mutex
1515
import kotlinx.coroutines.sync.withLock
16-
import net.thunderbird.core.logging.config.DebugLogConfigurator
16+
import net.thunderbird.core.logging.legacy.DebugLogConfigurator
1717
import net.thunderbird.core.preference.GeneralSettings
1818
import net.thunderbird.core.preference.GeneralSettingsManager
1919
import net.thunderbird.core.preference.PreferenceChangePublisher

legacy/core/src/main/java/com/fsck/k9/preferences/KoinModule.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package com.fsck.k9.preferences
33
import com.fsck.k9.Preferences
44
import kotlin.time.ExperimentalTime
55
import net.thunderbird.core.android.account.LegacyAccountDtoManager
6-
import net.thunderbird.core.logging.config.DebugLogConfigurator
6+
import net.thunderbird.core.logging.legacy.DebugLogConfigurator
77
import net.thunderbird.core.preference.DefaultPreferenceChangeBroker
88
import net.thunderbird.core.preference.GeneralSettingsManager
99
import net.thunderbird.core.preference.PreferenceChangeBroker

quality/konsist/src/test/kotlin/net/thunderbird/quality/ValidateLogger.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class ValidateLogger {
3030
.filterNot { it.hasNameMatching("ConsoleLogSink.android|ConsoleLogSinkTest.android".toRegex()) }
3131
.filterNot {
3232
// Exclude legacy code that still uses Timber
33-
it.hasNameMatching("LogFileWriter|FileLoggerTree|K9".toRegex())
33+
it.hasNameMatching("LogFileWriter|FileLoggerTree|K9|DebugLogConfigurator".toRegex())
3434
}
3535
.assertFalse(
3636
additionalMessage = "No class should use timber.log.Timber import, use net.thunderbird.core.logging.Logger instead."

settings.gradle.kts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,6 @@ include(
153153
":core:configstore:impl-backend",
154154
":core:featureflag",
155155
":core:logging:api",
156-
":core:logging:config",
157156
":core:logging:impl-composite",
158157
":core:logging:impl-console",
159158
":core:logging:impl-legacy",

0 commit comments

Comments
 (0)