Skip to content

Commit

Permalink
Only log event payload at trace level (#20097)
Browse files Browse the repository at this point in the history
While investigating why login is slow
#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.
  • Loading branch information
ilmotta authored May 21, 2024
1 parent b358c06 commit 88afa09
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/status_im/common/signals/events.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/status_im/contexts/wallet/signals.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand Down

0 comments on commit 88afa09

Please sign in to comment.