From 69c53aca0657552c4e86d1d71f16f4e8ba98d2bb Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Mon, 5 Jan 2026 19:26:00 -0500 Subject: [PATCH] Improving error logs --- amethyst/src/main/java/com/vitorpamplona/amethyst/AppModules.kt | 2 +- .../main/java/com/vitorpamplona/amethyst/model/LocalCache.kt | 2 +- .../nip01Core/relay/client/single/basic/BasicRelayClient.kt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/AppModules.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/AppModules.kt index e62736ca8..8f28543b3 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/AppModules.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/AppModules.kt @@ -200,7 +200,7 @@ class AppModules( val relayStats = RelayStats(client) // Logs debug messages when needed - val detailedLogger = if (isDebug) RelayLogger(client, true, false) else null + val detailedLogger = if (isDebug) RelayLogger(client, false, false) else null val relayReqStats = if (isDebug) RelayReqStats(client) else null val logger = if (isDebug) RelaySpeedLogger(client) else null diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/model/LocalCache.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/model/LocalCache.kt index 3a89e5538..1b452063f 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/model/LocalCache.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/model/LocalCache.kt @@ -2889,7 +2889,7 @@ object LocalCache : ILocalCache { } } catch (e: Exception) { if (e is CancellationException) throw e - Log.w("LocalCache", "Cannot consume ${event.kind}", e) + Log.w("LocalCache", "Cannot consume ${event.toJson()} from ${relay?.url}", e) false } diff --git a/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip01Core/relay/client/single/basic/BasicRelayClient.kt b/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip01Core/relay/client/single/basic/BasicRelayClient.kt index 0d765370c..71e420f13 100644 --- a/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip01Core/relay/client/single/basic/BasicRelayClient.kt +++ b/quartz/src/commonMain/kotlin/com/vitorpamplona/quartz/nip01Core/relay/client/single/basic/BasicRelayClient.kt @@ -128,7 +128,7 @@ open class BasicRelayClient( } catch (e: Throwable) { if (e is CancellationException) throw e // doesn't expose parsing errors to lib users as errors - Log.e("BasicRelayClient", "Failure to parse message from Relay", e) + Log.e("BasicRelayClient", "Failure to parse message from Relay: $text", e) } }