From 88afa09bafff884b2ef22eec4f3a9258c0d4635c Mon Sep 17 00:00:00 2001 From: Icaro Motta Date: Mon, 20 May 2024 23:06:38 -0300 Subject: [PATCH] Only log event payload at trace level (#20097) While investigating why login is slow https://github.com/status-im/status-mobile/issues/20059 and when testing with accounts with communities, I noticed we are logging huge payloads because they include data URLs. This makes debugging the app harder. Therefore, we will now log the full event payload only at the trace level, and at the debug level we only log the event type. This problem was first described by ulisesmac. --- src/status_im/common/signals/events.cljs | 3 ++- src/status_im/contexts/wallet/signals.cljs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/status_im/common/signals/events.cljs b/src/status_im/common/signals/events.cljs index 4f3a96ae52..1b8e442bc5 100644 --- a/src/status_im/common/signals/events.cljs +++ b/src/status_im/common/signals/events.cljs @@ -35,7 +35,8 @@ (let [^js data (.parse js/JSON event-str) ^js event-js (.-event data) type (.-type data)] - (log/debug "Signal received" event-str) + (log/debug "Signal received" {:type type}) + (log/trace "Signal received" {:payload event-str}) (case type "node.login" {:fx [[:dispatch [:profile.login/login-node-signal diff --git a/src/status_im/contexts/wallet/signals.cljs b/src/status_im/contexts/wallet/signals.cljs index fa296d434c..c3a0d3aebe 100644 --- a/src/status_im/contexts/wallet/signals.cljs +++ b/src/status_im/contexts/wallet/signals.cljs @@ -18,7 +18,7 @@ (let [event-type (oops/oget event-js "type") blockNumber (oops/oget event-js "blockNumber") accounts (oops/oget event-js "accounts")] - (log/debug "[wallet-subs] New wallet event" + (log/debug "[wallet] Wallet signal received" {:type event-type :block-number blockNumber :accounts accounts})