Skip to content

Commit d22a1b3

Browse files
committed
Adding logs
1 parent 50139f4 commit d22a1b3

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

WordPress/src/main/java/org/wordpress/android/ui/accounts/login/ApplicationPasswordLoginHelper.kt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package org.wordpress.android.ui.accounts.login
22

3-
import android.util.Log
43
import androidx.core.net.toUri
54
import kotlinx.coroutines.CoroutineDispatcher
65
import kotlinx.coroutines.withContext
@@ -56,8 +55,10 @@ class ApplicationPasswordLoginHelper @Inject constructor(
5655
}
5756
val authorizationUrlComplete =
5857
uriLoginWrapper.appendParamsToRestAuthorizationUrl(authorizationUrl)
59-
Log.d("WP_RS", "Found authorization for $siteUrl URL: $authorizationUrlComplete" +
60-
" API_ROOT_URL $apiRootUrl")
58+
appLogWrapper.d(
59+
AppLog.T.API,
60+
"WP_RS: Found authorization for $siteUrl URL: $authorizationUrlComplete " +
61+
"API_ROOT_URL $apiRootUrl")
6162
AnalyticsTracker.track(Stat.BACKGROUND_REST_AUTODISCOVERY_SUCCESSFUL)
6263
authorizationUrlComplete
6364
}

WordPress/src/main/java/org/wordpress/android/ui/mysite/cards/applicationpassword/ApplicationPasswordViewModelSlice.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import kotlinx.coroutines.launch
77
import org.wordpress.android.R
88
import org.wordpress.android.fluxc.model.SiteModel
99
import org.wordpress.android.fluxc.store.SiteStore
10+
import org.wordpress.android.fluxc.utils.AppLogWrapper
1011
import org.wordpress.android.ui.accounts.login.ApplicationPasswordLoginHelper
1112
import org.wordpress.android.ui.mysite.MySiteCardAndItem
1213
import org.wordpress.android.ui.mysite.MySiteCardAndItem.Card.QuickLinksItem.QuickLinkItem
@@ -16,13 +17,15 @@ import org.wordpress.android.ui.prefs.experimentalfeatures.ExperimentalFeatures
1617
import org.wordpress.android.ui.prefs.experimentalfeatures.ExperimentalFeatures.Feature
1718
import org.wordpress.android.ui.utils.ListItemInteraction
1819
import org.wordpress.android.ui.utils.UiString.UiStringRes
20+
import org.wordpress.android.util.AppLog
1921
import org.wordpress.android.viewmodel.Event
2022
import javax.inject.Inject
2123

2224
class ApplicationPasswordViewModelSlice @Inject constructor(
2325
private val applicationPasswordLoginHelper: ApplicationPasswordLoginHelper,
2426
private val siteStore: SiteStore,
2527
private val experimentalFeatures: ExperimentalFeatures,
28+
private val appLogWrapper: AppLogWrapper,
2629
) {
2730
lateinit var scope: CoroutineScope
2831

@@ -57,12 +60,14 @@ class ApplicationPasswordViewModelSlice @Inject constructor(
5760
val storedSite = siteStore.sites.firstOrNull { it.id == site.id }
5861
if (storedSite != null && !applicationPasswordLoginHelper.siteHasBadCredentials(site)) {
5962
uiModelMutable.postValue(null)
63+
appLogWrapper.d(AppLog.T.MAIN, "WP_RS: Hiding card for ${site.url} - authenticated")
6064
return@launch
6165
}
6266

6367
val authorizationUrlComplete = applicationPasswordLoginHelper.getAuthorizationUrlComplete(site.url)
6468
if (authorizationUrlComplete.isEmpty()) {
6569
uiModelMutable.postValue(null)
70+
appLogWrapper.d(AppLog.T.MAIN, "WP_RS: Hiding card for ${site.url} - bad discovery")
6671
} else {
6772
showApplicationPasswordCreateCard(site)
6873
}
@@ -81,6 +86,7 @@ class ApplicationPasswordViewModelSlice @Inject constructor(
8186
)
8287
)
8388
)
89+
appLogWrapper.d(AppLog.T.MAIN, "WP_RS: Showing card for ${site.url}")
8490
}
8591

8692

0 commit comments

Comments
 (0)