mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-10-06 03:38:23 +00:00
refactor: use lambda Log overload for interpolated log calls
This commit is contained in:
@@ -1873,11 +1873,11 @@ object LocalCache : ILocalCache, ICacheProvider {
|
||||
if (result is LnZapReceiptValidator.Result.Invalid &&
|
||||
result.reason != LnZapReceiptValidator.Result.Reason.MISMATCHED_LNURL
|
||||
) {
|
||||
Log.w("ZP", "dropping zap receipt ${event.id}: ${result.reason} ${result.detail ?: ""}")
|
||||
Log.w("ZP") { "dropping zap receipt ${event.id}: ${result.reason} ${result.detail ?: ""}" }
|
||||
return false
|
||||
}
|
||||
if (result is LnZapReceiptValidator.Result.Invalid) {
|
||||
Log.w("ZP", "zap receipt ${event.id} has mismatched lnurl tag (accepting per SHOULD)")
|
||||
Log.w("ZP") { "zap receipt ${event.id} has mismatched lnurl tag (accepting per SHOULD)" }
|
||||
}
|
||||
|
||||
note.loadEvent(event, author, repliesTo)
|
||||
@@ -1908,7 +1908,7 @@ object LocalCache : ILocalCache, ICacheProvider {
|
||||
try {
|
||||
val info = resolver.resolve(recipientLnurlpUrl)
|
||||
if (info == null) {
|
||||
Log.w("ZP", "could not fetch lnurlp for ${event.id}; not crediting")
|
||||
Log.w("ZP") { "could not fetch lnurlp for ${event.id}; not crediting" }
|
||||
return@launch
|
||||
}
|
||||
val result =
|
||||
@@ -1920,11 +1920,11 @@ object LocalCache : ILocalCache, ICacheProvider {
|
||||
if (result is LnZapReceiptValidator.Result.Invalid &&
|
||||
result.reason != LnZapReceiptValidator.Result.Reason.MISMATCHED_LNURL
|
||||
) {
|
||||
Log.w("ZP", "dropping zap receipt ${event.id}: ${result.reason} ${result.detail ?: ""}")
|
||||
Log.w("ZP") { "dropping zap receipt ${event.id}: ${result.reason} ${result.detail ?: ""}" }
|
||||
return@launch
|
||||
}
|
||||
if (result is LnZapReceiptValidator.Result.Invalid) {
|
||||
Log.w("ZP", "zap receipt ${event.id} has mismatched lnurl tag (accepting per SHOULD)")
|
||||
Log.w("ZP") { "zap receipt ${event.id} has mismatched lnurl tag (accepting per SHOULD)" }
|
||||
}
|
||||
repliesTo.forEach { it.addZap(zapRequest, note) }
|
||||
} catch (t: Throwable) {
|
||||
@@ -2221,7 +2221,7 @@ object LocalCache : ILocalCache, ICacheProvider {
|
||||
if (wasVerified || justVerify(event)) {
|
||||
val expectedServicePubkey =
|
||||
event.walletServicePubKey() ?: run {
|
||||
Log.w("LocalCache", "NWC request ${event.id} has no `p` tag; cannot register for response.")
|
||||
Log.w("LocalCache") { "NWC request ${event.id} has no `p` tag; cannot register for response." }
|
||||
return false
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -111,7 +111,7 @@ class RelayProxyClientConnector(
|
||||
lastTorConnection = it.torConnection
|
||||
lastClearConnection = it.clearConnection
|
||||
|
||||
Log.d("ManageRelayServices", "Relay Services have changed, reconnecting relays that need to (transportChanged=$transportChanged)")
|
||||
Log.d("ManageRelayServices") { "Relay Services have changed, reconnecting relays that need to (transportChanged=$transportChanged)" }
|
||||
client.reconnect(
|
||||
onlyIfChanged = true,
|
||||
ignoreRetryDelays = transportChanged,
|
||||
|
||||
+1
-1
@@ -257,7 +257,7 @@ class ScheduledPostStore(
|
||||
Log.w(TAG) { "Failed to delete existing $storageFile before rename retry" }
|
||||
}
|
||||
if (!tmp.renameTo(storageFile)) {
|
||||
Log.e(TAG, "Failed to rename $tmp to $storageFile")
|
||||
Log.e(TAG) { "Failed to rename $tmp to $storageFile" }
|
||||
if (!tmp.delete()) {
|
||||
Log.w(TAG) { "Failed to clean up temp file $tmp after rename failure" }
|
||||
}
|
||||
|
||||
+2
-2
@@ -141,7 +141,7 @@ class ScheduledPostWorker(
|
||||
}
|
||||
val account = appModules.accountsCache.accounts.value[post.accountPubkey]
|
||||
if (account == null) {
|
||||
Log.w(TAG, "Account ${post.accountPubkey} not loaded; releasing ${post.id} for retry")
|
||||
Log.w(TAG) { "Account ${post.accountPubkey} not loaded; releasing ${post.id} for retry" }
|
||||
store.releaseClaim(post.id)
|
||||
continue
|
||||
}
|
||||
@@ -164,7 +164,7 @@ class ScheduledPostWorker(
|
||||
val msg = "no relay acknowledged within ${OK_TIMEOUT_SEC}s"
|
||||
store.markFailed(post.id, msg)
|
||||
ScheduledPostNotifier.notifyFailed(applicationContext, post, msg)
|
||||
Log.w(TAG, "client.publish(${post.id}) failed: $msg")
|
||||
Log.w(TAG) { "client.publish(${post.id}) failed: $msg" }
|
||||
}
|
||||
} catch (e: CancellationException) {
|
||||
throw e
|
||||
|
||||
Reference in New Issue
Block a user