From b74af5c67d3df3da68039d7ed1175b13aa162665 Mon Sep 17 00:00:00 2001 From: Julian Fortune Date: Wed, 24 Jan 2024 09:52:49 -0800 Subject: [PATCH] Adds logging --- .../substrateclient/transport/ws/WsProvider.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/transport/src/main/java/com/strategyobject/substrateclient/transport/ws/WsProvider.java b/transport/src/main/java/com/strategyobject/substrateclient/transport/ws/WsProvider.java index 6691f68..d1ef337 100644 --- a/transport/src/main/java/com/strategyobject/substrateclient/transport/ws/WsProvider.java +++ b/transport/src/main/java/com/strategyobject/substrateclient/transport/ws/WsProvider.java @@ -295,6 +295,7 @@ public CompletableFuture subscribe(String type, */ @Override public CompletableFuture unsubscribe(String type, String method, String id) { + log.info("[unsubscribe] Unsubscribing for type={}, method={}, id={}", type, method, id); val subscription = type + "::" + id; val whenUnsubscribed = new CompletableFuture(); @@ -303,12 +304,14 @@ public CompletableFuture unsubscribe(String type, String method, String // a slight complication in solving - since we cannot rely on the sent id, but rather // need to find the actual subscription id to map it if (this.subscriptions.get(subscription) == null) { - log.info("Unable to find active subscription={}", subscription); + log.info("[unsubscribe] Unable to find active subscription={}", subscription); whenUnsubscribed.complete(false); } else { + log.info("[unsubscribe] Found active subscription={}", subscription); this.subscriptions.remove(subscription); if (this.isConnected() && this.webSocket != null) { + log.info("[unsubscribe] Submitting method={}, id={}", method, id); return this.send(method, Collections.singletonList(id), null) .thenApplyAsync(RpcObject::asBoolean); }