Skip to content

Commit 48c83ef

Browse files
authored
fix_: no log file (#22122)
* fix_: no log file status-im/status-go@c5e4eb1...388fce1 * chore_: fix lint issue * chore_: set error level for release build status-im/status-go@c5e4eb1...ba8fd51
1 parent c84fc71 commit 48c83ef

File tree

4 files changed

+36
-13
lines changed

4 files changed

+36
-13
lines changed

.env.release

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ DEBUG_WEBVIEW=0
22
ETHEREUM_DEV_CLUSTER=0
33
EXTENSIONS=0
44
GROUP_CHATS_ENABLED=1
5-
LOG_LEVEL=
5+
LOG_LEVEL=error
66
MAILSERVER_CONFIRMATIONS_ENABLED=1
77
MAINNET_WARNING_ENABLED=1
88
PFS_ENCRYPTION_ENABLED=1

src/legacy/status_im/log_level/core.cljs

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,41 @@
22
(:require
33
[legacy.status-im.multiaccounts.update.core :as multiaccounts.update]
44
[re-frame.core :as re-frame]
5+
[taoensso.timbre :as log]
56
[utils.i18n :as i18n]
67
[utils.re-frame :as rf]))
78

89
(rf/defn save-log-level
910
{:events [:log-level.ui/change-log-level-confirmed]}
10-
[{:keys [db] :as cofx} log-level]
11+
[{:keys [db]} log-level]
1112
(let [old-log-level (get-in db [:profile/profile :log-level])]
1213
(when (not= old-log-level log-level)
13-
(multiaccounts.update/multiaccount-update
14-
cofx
15-
:log-level
16-
log-level
17-
{:on-success #(re-frame/dispatch [:profile/logout])}))))
14+
(let [need-set-log-enabled? (or (empty? old-log-level) (empty? log-level))
15+
log-enabled? (boolean (seq log-level))
16+
rpc-calls (cond-> []
17+
log-enabled?
18+
(conj {:method "wakuext_setLogLevel"
19+
:params [{:logLevel log-level}]
20+
:on-error #(log/error "Failed to set log level" %)})
21+
22+
need-set-log-enabled?
23+
(conj {:method "wakuext_setLogEnabled"
24+
:params [log-enabled?]
25+
:on-error #(log/error "Failed to set log enabled" %)}))]
26+
{:fx [[:json-rpc/call
27+
(conj (vec (map #(assoc % :on-success nil) (butlast rpc-calls)))
28+
(assoc (last rpc-calls)
29+
:on-success
30+
#(rf/dispatch [:log-level/update-multiaccount log-level])))]]}))))
31+
32+
(rf/defn update-multiaccount
33+
{:events [:log-level/update-multiaccount]}
34+
[cofx log-level]
35+
(multiaccounts.update/multiaccount-update
36+
cofx
37+
:log-level
38+
log-level
39+
{:on-success #(rf/dispatch [:profile/logout])}))
1840

1941
(rf/defn show-change-log-level-confirmation
2042
{:events [:log-level.ui/log-level-selected]}

src/legacy/status_im/ui/screens/log_level_settings/views.cljs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@
3333
name]]]]))
3434

3535
(def log-levels
36+
"The status-go log library (zap) doesn't support the trace level, so we remove
37+
the trace option from the UI. When trace is enabled an error will happen while
38+
trying to login (user will see the error 'wrong password')."
3639
[{:name "DISABLED"
3740
:value ""}
3841
{:name "ERROR"
@@ -42,9 +45,7 @@
4245
{:name "INFO"
4346
:value "INFO"}
4447
{:name "DEBUG"
45-
:value "DEBUG"}
46-
{:name "TRACE"
47-
:value "TRACE"}])
48+
:value "DEBUG"}])
4849

4950
(views/defview log-level-settings
5051
[]

status-go-version.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"_comment": "Instead use: scripts/update-status-go.sh <rev>",
44
"owner": "status-im",
55
"repo": "status-go",
6-
"version": "v10.6.0",
7-
"commit-sha1": "c5e4eb1a56ea7641efcc7cc677be7fd5d3f92225",
8-
"src-sha256": "0n8x03c4dqxwcl27y8x6hmn6wbfpq3llkj15hhjxc4baaqwrhy8i"
6+
"version": "v10.8.0",
7+
"commit-sha1": "ba8fd51958686aea45e34e684ac925a4e65927f8",
8+
"src-sha256": "0kqn5rkfsn7aqc2n2flqvkm6cc53ssk0mc1l84f4czg0paci0717"
99
}

0 commit comments

Comments
 (0)