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.
This commit is contained in:
Icaro Motta 2024-05-20 23:06:38 -03:00 committed by GitHub
parent b358c06a31
commit 88afa09baf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 2 deletions

View File

@ -35,7 +35,8 @@
(let [^js data (.parse js/JSON event-str) (let [^js data (.parse js/JSON event-str)
^js event-js (.-event data) ^js event-js (.-event data)
type (.-type 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 (case type
"node.login" {:fx [[:dispatch "node.login" {:fx [[:dispatch
[:profile.login/login-node-signal [:profile.login/login-node-signal

View File

@ -18,7 +18,7 @@
(let [event-type (oops/oget event-js "type") (let [event-type (oops/oget event-js "type")
blockNumber (oops/oget event-js "blockNumber") blockNumber (oops/oget event-js "blockNumber")
accounts (oops/oget event-js "accounts")] accounts (oops/oget event-js "accounts")]
(log/debug "[wallet-subs] New wallet event" (log/debug "[wallet] Wallet signal received"
{:type event-type {:type event-type
:block-number blockNumber :block-number blockNumber
:accounts accounts}) :accounts accounts})