From b046fd91cb32fcb1616a6301070794a3f2de8682 Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Thu, 11 Apr 2024 18:30:28 -0400 Subject: [PATCH] Only logs external signer calls on debug --- .../quartz/signers/NostrSignerExternal.kt | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/quartz/src/main/java/com/vitorpamplona/quartz/signers/NostrSignerExternal.kt b/quartz/src/main/java/com/vitorpamplona/quartz/signers/NostrSignerExternal.kt index 4f34af999..f65cf4f4c 100644 --- a/quartz/src/main/java/com/vitorpamplona/quartz/signers/NostrSignerExternal.kt +++ b/quartz/src/main/java/com/vitorpamplona/quartz/signers/NostrSignerExternal.kt @@ -21,6 +21,7 @@ package com.vitorpamplona.quartz.signers import android.util.Log +import com.goterl.lazysodium.BuildConfig import com.vitorpamplona.quartz.encoders.HexKey import com.vitorpamplona.quartz.encoders.hexToByteArray import com.vitorpamplona.quartz.encoders.toHexKey @@ -91,7 +92,9 @@ class NostrSignerExternal( toPublicKey: HexKey, onReady: (String) -> Unit, ) { - Log.d("NostrExternalSigner", "Encrypt NIP04 Event: $decryptedContent") + if (BuildConfig.DEBUG) { + Log.d("NostrExternalSigner", "Encrypt NIP04 Event: $decryptedContent") + } return launcher.encrypt( decryptedContent, @@ -106,7 +109,9 @@ class NostrSignerExternal( fromPublicKey: HexKey, onReady: (String) -> Unit, ) { - Log.d("NostrExternalSigner", "Decrypt NIP04 Event: $encryptedContent") + if (BuildConfig.DEBUG) { + Log.d("NostrExternalSigner", "Decrypt NIP04 Event: $encryptedContent") + } return launcher.decrypt( encryptedContent, @@ -121,7 +126,9 @@ class NostrSignerExternal( toPublicKey: HexKey, onReady: (String) -> Unit, ) { - Log.d("NostrExternalSigner", "Encrypt NIP44 Event: $decryptedContent") + if (BuildConfig.DEBUG) { + Log.d("NostrExternalSigner", "Encrypt NIP44 Event: $decryptedContent") + } return launcher.encrypt( decryptedContent, @@ -136,7 +143,9 @@ class NostrSignerExternal( fromPublicKey: HexKey, onReady: (String) -> Unit, ) { - Log.d("NostrExternalSigner", "Decrypt NIP44 Event: $encryptedContent") + if (BuildConfig.DEBUG) { + Log.d("NostrExternalSigner", "Decrypt NIP44 Event: $encryptedContent") + } return launcher.decrypt( encryptedContent,