Fix lint warning about Timber (#6521)

Change trivial string formatting and function calls
for Timber logging.

This resolves all the lint warnings in the
Android/Lint/Correctness/Messages group.
This commit is contained in:
Amir E. Aharoni 2025-10-18 00:45:35 -04:00 committed by GitHub
parent 29b6d0f8fe
commit 717a855149
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 4 additions and 3 deletions

View file

@ -324,7 +324,7 @@ after opening the app.
) )
.subscribeOn(Schedulers.io()) .subscribeOn(Schedulers.io())
.blockingGet() .blockingGet()
Timber.d("Resuming " + stuckUploads.size + " uploads...") Timber.d("Resuming %d uploads...", stuckUploads.size)
if (!stuckUploads.isEmpty()) { if (!stuckUploads.isEmpty()) {
for (contribution in stuckUploads) { for (contribution in stuckUploads) {
contribution.state = Contribution.STATE_QUEUED contribution.state = Contribution.STATE_QUEUED

View file

@ -27,6 +27,7 @@ import java.io.File
import java.io.FileOutputStream import java.io.FileOutputStream
import java.util.Locale import java.util.Locale
import javax.inject.Inject import javax.inject.Inject
import timber.log.Timber
/** /**
* This activity will set two tabs, achievements and * This activity will set two tabs, achievements and
@ -122,7 +123,7 @@ class ProfileActivity : BaseActivity() {
val rootView = window.decorView.findViewById<View>(android.R.id.content) val rootView = window.decorView.findViewById<View>(android.R.id.content)
val screenShot = getScreenShot(rootView) val screenShot = getScreenShot(rootView)
if (screenShot == null) { if (screenShot == null) {
Log.e("ERROR", "ScreenShot is null") Timber.e("ScreenShot is null")
return false return false
} }
showAlert(screenShot) showAlert(screenShot)

View file

@ -37,7 +37,7 @@ object LocationUtils {
latLng = LatLng(latLngArray[1].trim().toDouble(), latLng = LatLng(latLngArray[1].trim().toDouble(),
latLngArray[0].trim().toDouble(), 1f) latLngArray[0].trim().toDouble(), 1f)
} catch (e: Exception) { } catch (e: Exception) {
Timber.e("Error while parsing user entered lat long: %s", e) Timber.e(e, "Error while parsing user entered lat long")
} }
return latLng return latLng