Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit f88679b1 authored by Wolf-Martell Montwé's avatar Wolf-Martell Montwé
Browse files

refactor(core-logging): replace mail logging by core logging legacy

parent bf96a490
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -11,7 +11,6 @@ import com.fsck.k9.K9
import com.fsck.k9.MessagingListenerProvider
import com.fsck.k9.controller.MessagingController
import com.fsck.k9.job.WorkManagerConfigurationProvider
import com.fsck.k9.logging.Timber
import com.fsck.k9.notification.NotificationChannelManager
import com.fsck.k9.ui.base.AppLanguageManager
import com.fsck.k9.ui.base.extensions.currentLocale
@@ -99,7 +98,7 @@ abstract class BaseApplication : Application(), WorkManagerConfiguration.Provide
    }

    private fun updateConfigurationWithLocale(configuration: Configuration, locale: Locale) {
        Timber.d("Updating application configuration with locale '$locale'")
        Log.d("Updating application configuration with locale '$locale'")

        val newConfiguration = Configuration(configuration).apply {
            currentLocale = locale
@@ -123,7 +122,7 @@ abstract class BaseApplication : Application(), WorkManagerConfiguration.Provide
        if (appLanguageManagerInitialized) {
            appLanguageManager.getOverrideLocale()?.let { overrideLocale ->
                if (resources.configuration.currentLocale != overrideLocale) {
                    Timber.w("Resources configuration was reset. Re-applying locale override.")
                    Log.w("Resources configuration was reset. Re-applying locale override.")
                    appLanguageManager.applyOverrideLocale()
                    applyOverrideLocaleToConfiguration()
                }
+2 −2
Original line number Diff line number Diff line
@@ -10,7 +10,6 @@ import com.fsck.k9.Core
import com.fsck.k9.Preferences
import com.fsck.k9.account.DeletePolicyProvider
import com.fsck.k9.controller.MessagingController
import com.fsck.k9.logging.Timber
import com.fsck.k9.mail.ServerSettings
import com.fsck.k9.mail.store.imap.ImapStoreSettings.autoDetectNamespace
import com.fsck.k9.mail.store.imap.ImapStoreSettings.createExtra
@@ -24,6 +23,7 @@ import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
import net.thunderbird.core.android.account.LegacyAccount
import net.thunderbird.core.common.mail.Protocols
import net.thunderbird.core.logging.legacy.Log
import net.thunderbird.feature.mail.folder.api.SpecialFolderSelection

// TODO Move to feature/account/setup
@@ -43,7 +43,7 @@ internal class AccountCreator(
        return try {
            withContext(coroutineDispatcher) { AccountCreatorResult.Success(create(account)) }
        } catch (e: Exception) {
            Timber.e(e, "Error while creating new account")
            Log.e(e, "Error while creating new account")

            AccountCreatorResult.Error(e.message ?: "Unknown create account error")
        }
+1 −0
Original line number Diff line number Diff line
@@ -14,6 +14,7 @@ dependencies {

    implementation(libs.kotlinx.coroutines.core)

    testImplementation(projects.core.logging.testing)
    testImplementation(projects.mail.testing)
    testImplementation(projects.backend.testing)
    testImplementation(libs.mime4j.dom)
+3 −3
Original line number Diff line number Diff line
package com.fsck.k9.backend.imap

import com.fsck.k9.logging.Timber
import com.fsck.k9.mail.store.imap.ImapStore
import com.fsck.k9.mail.store.imap.OpenMode
import net.thunderbird.core.logging.legacy.Log

internal class CommandExpunge(private val imapStore: ImapStore) {

    fun expunge(folderServerId: String) {
        Timber.d("processPendingExpunge: folder = %s", folderServerId)
        Log.d("processPendingExpunge: folder = %s", folderServerId)

        val remoteFolder = imapStore.getFolder(folderServerId)
        try {
@@ -15,7 +15,7 @@ internal class CommandExpunge(private val imapStore: ImapStore) {

            remoteFolder.expunge()

            Timber.d("processPendingExpunge: complete for folder = %s", folderServerId)
            Log.d("processPendingExpunge: complete for folder = %s", folderServerId)
        } finally {
            remoteFolder.close()
        }
+3 −3
Original line number Diff line number Diff line
package com.fsck.k9.backend.imap

import com.fsck.k9.logging.Timber
import com.fsck.k9.mail.store.imap.ImapFolder
import com.fsck.k9.mail.store.imap.ImapStore
import com.fsck.k9.mail.store.imap.OpenMode
import net.thunderbird.core.logging.legacy.Log

internal class CommandMoveOrCopyMessages(private val imapStore: ImapStore) {

@@ -36,7 +36,7 @@ internal class CommandMoveOrCopyMessages(private val imapStore: ImapStore) {
            remoteSrcFolder = imapStore.getFolder(srcFolder)

            if (uids.isEmpty()) {
                Timber.i("moveOrCopyMessages: no remote messages to move, skipping")
                Log.i("moveOrCopyMessages: no remote messages to move, skipping")
                return null
            }

@@ -44,7 +44,7 @@ internal class CommandMoveOrCopyMessages(private val imapStore: ImapStore) {

            val messages = uids.map { uid -> remoteSrcFolder.getMessage(uid) }

            Timber.d(
            Log.d(
                "moveOrCopyMessages: source folder = %s, %d messages, destination folder = %s, isCopy = %s",
                srcFolder,
                messages.size,
Loading