From 34805cfa8d19f863828609843d7968026ad808a1 Mon Sep 17 00:00:00 2001 From: Bartosz Rozwarski Date: Thu, 31 Aug 2023 15:29:11 +0100 Subject: [PATCH] update logging --- .../NotifySubscribeResponseSubscriber.swift | 12 ++++++------ Sources/Web3Inbox/Web3InboxClient.swift | 1 + 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Sources/WalletConnectNotify/Client/Wallet/ProtocolEngine/wc_pushSubscribe/NotifySubscribeResponseSubscriber.swift b/Sources/WalletConnectNotify/Client/Wallet/ProtocolEngine/wc_pushSubscribe/NotifySubscribeResponseSubscriber.swift index 48d32401b..d5349d8c0 100644 --- a/Sources/WalletConnectNotify/Client/Wallet/ProtocolEngine/wc_pushSubscribe/NotifySubscribeResponseSubscriber.swift +++ b/Sources/WalletConnectNotify/Client/Wallet/ProtocolEngine/wc_pushSubscribe/NotifySubscribeResponseSubscriber.swift @@ -44,14 +44,14 @@ class NotifySubscribeResponseSubscriber { networkingInteractor.responseSubscription(on: protocolMethod) .sink { [unowned self] (payload: ResponseSubscriptionPayload) in Task(priority: .high) { - logger.debug("NotifySubscribeResponseSubscriber: Received Notify Subscribe response") + logger.debug("Received Notify Subscribe response") guard let (responsePayload, _) = try? NotifySubscriptionResponsePayload.decodeAndVerify(from: payload.response) else { fatalError() /* TODO: Handle error */ } guard let responseKeys = kms.getAgreementSecret(for: payload.topic) else { - logger.debug("NotifySubscribeResponseSubscriber: no symmetric key for topic \(payload.topic)") + logger.debug("No symmetric key for topic \(payload.topic)") return subscriptionErrorSubject.send(Errors.couldNotCreateSubscription) } @@ -77,15 +77,15 @@ class NotifySubscribeResponseSubscriber { metadata = try dappsMetadataStore.get(key: payload.topic) let availableTypes = try await subscriptionScopeProvider.getSubscriptionScope(dappUrl: metadata!.url) subscribedTypes = availableTypes.filter{subscribedScope.contains($0.name)} - logger.debug("NotifySubscribeResponseSubscriber: subscribing notify subscription topic: \(notifySubscriptionTopic!)") + logger.debug("subscribing notify subscription topic: \(notifySubscriptionTopic!)") try await networkingInteractor.subscribe(topic: notifySubscriptionTopic) } catch { - logger.debug("NotifySubscribeResponseSubscriber: error: \(error)") + logger.debug("error: \(error)") return subscriptionErrorSubject.send(Errors.couldNotCreateSubscription) } guard let metadata = metadata else { - logger.debug("NotifySubscribeResponseSubscriber: no metadata for topic: \(notifySubscriptionTopic!)") + logger.debug("No metadata for topic: \(notifySubscriptionTopic!)") return subscriptionErrorSubject.send(Errors.couldNotCreateSubscription) } dappsMetadataStore.delete(forKey: payload.topic) @@ -95,7 +95,7 @@ class NotifySubscribeResponseSubscriber { try await notifyStorage.setSubscription(notifySubscription) - logger.debug("NotifySubscribeResponseSubscriber: unsubscribing response topic: \(payload.topic)") + logger.debug("Unsubscribing response topic: \(payload.topic)") networkingInteractor.unsubscribe(topic: payload.topic) } }.store(in: &publishers) diff --git a/Sources/Web3Inbox/Web3InboxClient.swift b/Sources/Web3Inbox/Web3InboxClient.swift index 2c3100200..d6277cb4e 100644 --- a/Sources/Web3Inbox/Web3InboxClient.swift +++ b/Sources/Web3Inbox/Web3InboxClient.swift @@ -22,6 +22,7 @@ public final class Web3InboxClient { public var logsPublisher: AnyPublisher { logger.logsPublisher + .merge(with: notifyClient.logsPublisher) .eraseToAnyPublisher() }