Skip to content
Snippets Groups Projects
Unverified Commit f5e6b1c3 authored by Matthias Urhahn's avatar Matthias Urhahn Committed by GitHub
Browse files

Force specific log tags in a few instances (#1249)

parent a301cbe8
No related branches found
No related tags found
No related merge requests found
......@@ -148,6 +148,7 @@ object RetrieveDiagnosisKeysTransaction : Transaction() {
if (LocalData.lastTimeDiagnosisKeysFromServerFetch() == null ||
currentDate.withTimeAtStartOfDay() != lastFetch.withTimeAtStartOfDay()
) {
Timber.tag(TAG).d("No keys fetched today yet (last=%s, now=%s)", lastFetch, currentDate)
BackgroundWorkHelper.sendDebugNotification(
"Start RetrieveDiagnosisKeysTransaction",
"No keys fetched today yet \n${DateTime.now()}\nUTC: $currentDate"
......
......@@ -140,9 +140,9 @@ class TracingViewModel : ViewModel() {
val isBackgroundJobEnabled =
ConnectivityHelper.autoModeEnabled(CoronaWarnApplication.getAppContext())
Timber.v("Keys were not retrieved today $keysWereNotRetrievedToday")
Timber.v("Network is enabled $isNetworkEnabled")
Timber.v("Background jobs are enabled $isBackgroundJobEnabled")
Timber.tag(TAG).v("Keys were not retrieved today $keysWereNotRetrievedToday")
Timber.tag(TAG).v("Network is enabled $isNetworkEnabled")
Timber.tag(TAG).v("Background jobs are enabled $isBackgroundJobEnabled")
if (keysWereNotRetrievedToday && isNetworkEnabled && isBackgroundJobEnabled) {
TracingRepository.isRefreshing.value = true
......@@ -219,7 +219,7 @@ class TracingViewModel : ViewModel() {
ExposureSummaryRepository.getExposureSummaryRepository()
.getLatestExposureSummary(token)
}
Timber.v("retrieved latest exposure summary from db")
Timber.tag(TAG).v("retrieved latest exposure summary from db")
} catch (e: Exception) {
e.report(
de.rki.coronawarnapp.exception.ExceptionCategory.EXPOSURENOTIFICATION,
......
......@@ -15,6 +15,7 @@ import javax.inject.Singleton
class VerificationKeys @Inject constructor() {
companion object {
private const val KEY_DELIMITER = ","
private val TAG = VerificationKeys::class.java.simpleName
}
private val keyFactory = KeyFactory.getInstance(KeyProperties.KEY_ALGORITHM_EC)
......@@ -28,8 +29,8 @@ class VerificationKeys @Inject constructor() {
signature.getValidSignaturesForExport(export, signatureListBinary)
.isEmpty()
.also {
if (it) Timber.d("export is invalid")
else Timber.d("export is valid")
if (it) Timber.tag(TAG).d("export is invalid")
else Timber.tag(TAG).d("export is valid")
}
}
......@@ -46,20 +47,20 @@ class VerificationKeys @Inject constructor() {
}
verified
}
.also { Timber.v("${it.size} valid signatures found") }
.also { Timber.tag(TAG).v("${it.size} valid signatures found") }
private fun getKeysForSignatureVerificationFilteredByEnvironment() =
BuildConfig.PUB_KEYS_SIGNATURE_VERIFICATION.split(KEY_DELIMITER)
.mapNotNull { delimitedString ->
Base64.decode(delimitedString, Base64.DEFAULT)
}.map { binaryPublicKey ->
keyFactory.generatePublic(
X509EncodedKeySpec(
binaryPublicKey
keyFactory.generatePublic(
X509EncodedKeySpec(
binaryPublicKey
)
)
)
}
.onEach { Timber.v("$it") }
}
.onEach { Timber.tag(TAG).v("$it") }
private fun getTEKSignaturesForEnvironment(
signatureListBinary: ByteArray?
......@@ -67,6 +68,6 @@ class VerificationKeys @Inject constructor() {
.parseFrom(signatureListBinary)
.signaturesList
.asSequence()
.onEach { Timber.v(it.toString()) }
.onEach { Timber.tag(TAG).v(it.toString()) }
.mapNotNull { it.signature.toByteArray() }
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment