aboutsummaryrefslogtreecommitdiff
path: root/wallet/src
diff options
context:
space:
mode:
authorTorsten Grote <t@grobox.de>2023-01-06 13:24:01 -0300
committerTorsten Grote <t@grobox.de>2023-01-06 13:24:01 -0300
commita5d6420ddf5c161eee31b6b12622e399cc5fb7e5 (patch)
treebc017abb35a7d540c9cbe89dfd82a71ccffa8a84 /wallet/src
parentab1f17d3877c065120bedcef30044fe51b8145e3 (diff)
downloadtaler-android-a5d6420ddf5c161eee31b6b12622e399cc5fb7e5.tar.gz
taler-android-a5d6420ddf5c161eee31b6b12622e399cc5fb7e5.tar.bz2
taler-android-a5d6420ddf5c161eee31b6b12622e399cc5fb7e5.zip
[wallet] Also log payload of wallet-core API requests
Diffstat (limited to 'wallet/src')
-rw-r--r--wallet/src/main/java/net/taler/wallet/backend/WalletBackendApi.kt8
1 files changed, 4 insertions, 4 deletions
diff --git a/wallet/src/main/java/net/taler/wallet/backend/WalletBackendApi.kt b/wallet/src/main/java/net/taler/wallet/backend/WalletBackendApi.kt
index 76aceb2..b07b717 100644
--- a/wallet/src/main/java/net/taler/wallet/backend/WalletBackendApi.kt
+++ b/wallet/src/main/java/net/taler/wallet/backend/WalletBackendApi.kt
@@ -44,7 +44,7 @@ import kotlin.coroutines.suspendCoroutine
class WalletBackendApi(
private val app: Application,
- private val notificationHandler: ((payload: JSONObject) -> Unit)
+ private val notificationHandler: ((payload: JSONObject) -> Unit),
) {
private var walletBackendMessenger: Messenger? = null
private val queuedMessages = LinkedList<Message>()
@@ -121,10 +121,10 @@ class WalletBackendApi(
fun sendRequest(
operation: String,
args: JSONObject? = null,
- onResponse: (isError: Boolean, message: JSONObject) -> Unit = { _, _ -> }
+ onResponse: (isError: Boolean, message: JSONObject) -> Unit = { _, _ -> },
) {
val requestID = nextRequestID.incrementAndGet()
- Log.i(TAG, "sending request for operation $operation ($requestID)")
+ Log.i(TAG, "sending request for operation $operation ($requestID)\n${args?.toString(2)}")
val msg = Message.obtain(null, MSG_COMMAND)
handlers[requestID] = onResponse
msg.replyTo = incomingMessenger
@@ -145,7 +145,7 @@ class WalletBackendApi(
suspend inline fun <reified T> request(
operation: String,
serializer: KSerializer<T>? = null,
- noinline args: (JSONObject.() -> JSONObject)? = null
+ noinline args: (JSONObject.() -> JSONObject)? = null,
): WalletResponse<T> = withContext(Dispatchers.Default) {
suspendCoroutine { cont ->
val json = Json {