Skip to content

Commit a90b20d

Browse files
committed
refactor: move DebugLogConfigurator to core:logging:config module
1 parent 058de77 commit a90b20d

6 files changed

Lines changed: 24 additions & 7 deletions

File tree

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
plugins {
2+
id(ThunderbirdPlugins.Library.kmp)
3+
}
4+
5+
android {
6+
namespace = "net.thunderbird.core.logging.config"
7+
}
8+
9+
kotlin {
10+
sourceSets {
11+
commonMain.dependencies {
12+
api(projects.core.logging.api)
13+
implementation(projects.core.logging.implComposite)
14+
implementation(projects.core.logging.implFile)
15+
}
16+
}
17+
}

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

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

33
import net.thunderbird.core.logging.composite.CompositeLogSink
44
import net.thunderbird.core.logging.file.FileLogSink
55
import timber.log.Timber
6-
import timber.log.Timber.DebugTree
76

8-
// TODO: Implementation https://github.com/thunderbird/thunderbird-android/issues/9573
97
class DebugLogConfigurator(
108
private val syncDebugCompositeSink: CompositeLogSink,
119
private val syncDebugFileLogSink: FileLogSink,
1210
) {
1311
fun updateLoggingStatus(isDebugLoggingEnabled: Boolean) {
14-
Timber.uprootAll()
12+
Timber.Forest.uprootAll()
1513
if (isDebugLoggingEnabled) {
16-
Timber.plant(DebugTree())
14+
Timber.Forest.plant(Timber.DebugTree())
1715
}
1816
}
1917

legacy/core/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ 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)
1617
api(projects.core.logging.implComposite)
1718
api(projects.core.android.network)
1819
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.legacy.DebugLogConfigurator
16+
import net.thunderbird.core.logging.config.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.legacy.DebugLogConfigurator
6+
import net.thunderbird.core.logging.config.DebugLogConfigurator
77
import net.thunderbird.core.preference.DefaultPreferenceChangeBroker
88
import net.thunderbird.core.preference.GeneralSettingsManager
99
import net.thunderbird.core.preference.PreferenceChangeBroker

settings.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ include(
153153
":core:configstore:impl-backend",
154154
":core:featureflag",
155155
":core:logging:api",
156+
":core:logging:config",
156157
":core:logging:impl-composite",
157158
":core:logging:impl-console",
158159
":core:logging:impl-legacy",

0 commit comments

Comments
 (0)