[#10870] "Invalid timbre logging level" after upgrade from 1.4 to 1.4.1 or relogin on 1.4.1

Signed-off-by: andrey <motor4ik@gmail.com>
This commit is contained in:
andrey 2020-06-25 16:44:08 +02:00
parent 1733d4dc83
commit 056dde0190
No known key found for this signature in database
GPG Key ID: 89B67245FD2F0272
11 changed files with 35 additions and 48 deletions

3
.env
View File

@ -8,8 +8,7 @@ EXTENSIONS=0
FLEET=eth.prod FLEET=eth.prod
GROUP_CHATS_ENABLED=1 GROUP_CHATS_ENABLED=1
HARDWALLET_ENABLED=1 HARDWALLET_ENABLED=1
LOG_LEVEL_STATUS_GO=info LOG_LEVEL=info
LOG_LEVEL=debug
MAILSERVER_CONFIRMATIONS_ENABLED=1 MAILSERVER_CONFIRMATIONS_ENABLED=1
PFS_ENCRYPTION_ENABLED=1 PFS_ENCRYPTION_ENABLED=1
PFS_TOGGLE_VISIBLE=1 PFS_TOGGLE_VISIBLE=1

View File

@ -6,8 +6,7 @@ EXTENSIONS=0
FLEET=eth.prod FLEET=eth.prod
GROUP_CHATS_ENABLED=1 GROUP_CHATS_ENABLED=1
HARDWALLET_ENABLED=1 HARDWALLET_ENABLED=1
LOG_LEVEL_STATUS_GO=info LOG_LEVEL=info
LOG_LEVEL=debug
MAILSERVER_CONFIRMATIONS_ENABLED=0 MAILSERVER_CONFIRMATIONS_ENABLED=0
PAIRING_POPUP_DISABLED=1 PAIRING_POPUP_DISABLED=1
PFS_ENCRYPTION_ENABLED=1 PFS_ENCRYPTION_ENABLED=1

View File

@ -7,8 +7,7 @@ EXTENSIONS=0
FLEET=eth.prod FLEET=eth.prod
GROUP_CHATS_ENABLED=1 GROUP_CHATS_ENABLED=1
HARDWALLET_ENABLED=1 HARDWALLET_ENABLED=1
LOG_LEVEL_STATUS_GO=info LOG_LEVEL=info
LOG_LEVEL=debug
MAILSERVER_CONFIRMATIONS_ENABLED=1 MAILSERVER_CONFIRMATIONS_ENABLED=1
MAINNET_WARNING_ENABLED=1 MAINNET_WARNING_ENABLED=1
PFS_ENCRYPTION_ENABLED=1 PFS_ENCRYPTION_ENABLED=1

View File

@ -5,8 +5,7 @@ ETHEREUM_DEV_CLUSTER=1
EXTENSIONS=0 EXTENSIONS=0
FLEET=eth.prod FLEET=eth.prod
GROUP_CHATS_ENABLED=1 GROUP_CHATS_ENABLED=1
LOG_LEVEL_STATUS_GO=info LOG_LEVEL=info
LOG_LEVEL=debug
MAILSERVER_CONFIRMATIONS_ENABLED=1 MAILSERVER_CONFIRMATIONS_ENABLED=1
MAINNET_WARNING_ENABLED=1 MAINNET_WARNING_ENABLED=1
PFS_ENCRYPTION_ENABLED=1 PFS_ENCRYPTION_ENABLED=1

View File

@ -5,8 +5,7 @@ ETHEREUM_DEV_CLUSTER=0
EXTENSIONS=0 EXTENSIONS=0
FLEET=eth.prod FLEET=eth.prod
GROUP_CHATS_ENABLED=1 GROUP_CHATS_ENABLED=1
LOG_LEVEL_STATUS_GO= LOG_LEVEL=
LOG_LEVEL=info
MAILSERVER_CONFIRMATIONS_ENABLED=1 MAILSERVER_CONFIRMATIONS_ENABLED=1
MAINNET_WARNING_ENABLED=1 MAINNET_WARNING_ENABLED=1
PFS_ENCRYPTION_ENABLED=1 PFS_ENCRYPTION_ENABLED=1

View File

@ -108,7 +108,7 @@
:currency :usd :currency :usd
:appearance 0 :appearance 0
:waku-enabled true :waku-enabled true
:log-level config/log-level-status-go}) :log-level config/log-level})
(defn default-visible-tokens [chain] (defn default-visible-tokens [chain]
(get-in default-multiaccount [:wallet/visible-tokens chain])) (get-in default-multiaccount [:wallet/visible-tokens chain]))

View File

@ -17,7 +17,8 @@
[status-im.utils.error-handler :as error-handler] [status-im.utils.error-handler :as error-handler]
[status-im.utils.logging.core :as utils.logs] [status-im.utils.logging.core :as utils.logs]
[status-im.utils.platform :as platform] [status-im.utils.platform :as platform]
[status-im.utils.snoopy :as snoopy])) [status-im.utils.snoopy :as snoopy]
[status-im.utils.config :as config]))
(set! interop/next-tick js/setTimeout) (set! interop/next-tick js/setTimeout)
(set! batching/fake-raf #(js/setTimeout % 0)) (set! batching/fake-raf #(js/setTimeout % 0))
@ -79,7 +80,7 @@
:reagent-render views/main})) :reagent-render views/main}))
(defn init [] (defn init []
(utils.logs/init-logs) (utils.logs/init-logs config/log-level)
(error-handler/register-exception-handler!) (error-handler/register-exception-handler!)
(enableScreens) (enableScreens)
(re-frame/dispatch-sync [:init/app-started]) (re-frame/dispatch-sync [:init/app-started])

View File

@ -8,7 +8,6 @@
[status-im.ui.components.react :as react] [status-im.ui.components.react :as react]
[status-im.utils.snoopy :as snoopy] [status-im.utils.snoopy :as snoopy]
[status-im.utils.error-handler :as error-handler] [status-im.utils.error-handler :as error-handler]
[status-im.utils.logging.core :as utils.logs]
[status-im.ui.screens.desktop.views :as desktop-views] [status-im.ui.screens.desktop.views :as desktop-views]
[status-im.desktop.deep-links :as deep-links] [status-im.desktop.deep-links :as deep-links]
[status-im.utils.config :as config])) [status-im.utils.config :as config]))
@ -39,7 +38,6 @@
desktop-views/main)}))) desktop-views/main)})))
(defn init [] (defn init []
(utils.logs/init-logs)
(error-handler/register-exception-handler!) (error-handler/register-exception-handler!)
(re-frame/dispatch-sync [:init/app-started]) (re-frame/dispatch-sync [:init/app-started])
(.registerComponent ^js app-registry "StatusIm" #(reagent/reactify-component app-root)) (.registerComponent ^js app-registry "StatusIm" #(reagent/reactify-component app-root))

View File

@ -195,7 +195,7 @@
(contact/initialize-contacts) (contact/initialize-contacts)
(stickers/init-stickers-packs) (stickers/init-stickers-packs)
(mobile-network/on-network-status-change) (mobile-network/on-network-status-change)
(logging/set-log-level multiaccount) (logging/set-log-level (:log-level multiaccount))
(multiaccounts/switch-preview-privacy-mode-flag)))) (multiaccounts/switch-preview-privacy-mode-flag))))
(defn get-new-auth-method [auth-method save-password?] (defn get-new-auth-method [auth-method save-password?]
@ -256,7 +256,7 @@
:mailserver-topics {} :mailserver-topics {}
:default-mailserver true}) :default-mailserver true})
(multiaccounts/switch-preview-privacy-mode-flag) (multiaccounts/switch-preview-privacy-mode-flag)
(logging/set-log-level multiaccount) (logging/set-log-level (:log-level multiaccount))
(when-not platform/desktop? (when-not platform/desktop?
(initialize-wallet accounts nil))))) (initialize-wallet accounts nil)))))

View File

@ -44,12 +44,7 @@
;; CONFIG VALUES ;; CONFIG VALUES
(def log-level (def log-level
(-> (get-config :LOG_LEVEL "error") (string/upper-case (get-config :LOG_LEVEL "")))
string/lower-case
keyword))
(def log-level-status-go
(-> (get-config :LOG_LEVEL_STATUS_GO "")
string/upper-case))
(def fleet (get-config :FLEET "eth.staging")) (def fleet (get-config :FLEET "eth.staging"))
(def default-network (get-config :DEFAULT_NETWORK)) (def default-network (get-config :DEFAULT_NETWORK))
(def pow-target (js/parseFloat (get-config :POW_TARGET "0.0001"))) (def pow-target (js/parseFloat (get-config :POW_TARGET "0.0001")))

View File

@ -1,18 +1,18 @@
(ns status-im.utils.logging.core (ns status-im.utils.logging.core
(:require [clojure.string :as clojure.string] (:require [re-frame.core :as re-frame]
[re-frame.core :as re-frame]
[status-im.native-module.core :as status] [status-im.native-module.core :as status]
[status-im.utils.fx :as fx] [status-im.utils.fx :as fx]
[status-im.utils.types :as types] [status-im.utils.types :as types]
[status-im.utils.handlers :as handlers] [status-im.utils.handlers :as handlers]
[status-im.utils.email :as mail] [status-im.utils.email :as mail]
[taoensso.timbre :as log] [taoensso.timbre :as log]
[status-im.utils.config :as config]
[status-im.i18n :as i18n] [status-im.i18n :as i18n]
[status-im.utils.platform :as platform] [status-im.utils.platform :as platform]
[status-im.utils.build :as build] [status-im.utils.build :as build]
[status-im.transport.utils :as transport.utils] [status-im.transport.utils :as transport.utils]
[status-im.utils.datetime :as datetime])) [status-im.utils.datetime :as datetime]
[clojure.string :as string]
[status-im.utils.config :as config]))
(def report-email "error-reports@status.im") (def report-email "error-reports@status.im")
(def max-log-entries 1000) (def max-log-entries 1000)
@ -22,17 +22,19 @@
(when (>= (count @logs-queue) max-log-entries) (when (>= (count @logs-queue) max-log-entries)
(swap! logs-queue pop))) (swap! logs-queue pop)))
(defn init-logs [] (defn init-logs [level]
(log/set-level! config/log-level) (when-not (string/blank? level)
(log/debug) (log/set-level! (-> level
(log/merge-config! string/lower-case
{:output-fn (fn [& data] keyword))
(let [res (apply log/default-output-fn data)] (log/merge-config!
(add-log-entry res) {:output-fn (fn [& data]
res))})) (let [res (apply log/default-output-fn data)]
(add-log-entry res)
res))})))
(defn get-js-logs [] (defn get-js-logs []
(clojure.string/join "\n" @logs-queue)) (string/join "\n" @logs-queue))
(re-frame/reg-fx (re-frame/reg-fx
:logs/archive-logs :logs/archive-logs
@ -44,18 +46,14 @@
(re-frame/reg-fx (re-frame/reg-fx
:logs/set-level :logs/set-level
(fn [log-level] (fn [level]
(log/set-level! log-level))) (init-logs level)))
(fx/defn set-log-level (fx/defn set-log-level
[{:keys [db]} multiaccount] [{:keys [db]} log-level]
(let [log-level (if-let [level (get multiaccount :log-level)] (let [log-level (or log-level config/log-level)]
(if (clojure.string/blank? level) "ERROR" level) {:db (assoc-in db [:multiaccount :log-level] log-level)
config/log-level-status-go)] :logs/set-level log-level}))
{:db (assoc-in db [:multiaccount :log-level] log-level)
:logs/set-level (-> log-level
clojure.string/lower-case
keyword)}))
(fx/defn send-logs (fx/defn send-logs
[{:keys [db]}] [{:keys [db]}]
@ -112,10 +110,10 @@
:node-info :peers-summary]}] :node-info :peers-summary]}]
(let [build-number (if platform/desktop? build/version build/build-no) (let [build-number (if platform/desktop? build/version build/build-no)
build-version (str build/version " (" build-number ")") build-version (str build/version " (" build-number ")")
separator (clojure.string/join (take 40 (repeat "-"))) separator (string/join (take 40 (repeat "-")))
[enode-id ip-address port] [enode-id ip-address port]
(transport.utils/extract-url-components (:enode node-info))] (transport.utils/extract-url-components (:enode node-info))]
(clojure.string/join (string/join
"\n" "\n"
(concat [(i18n/label :t/report-bug-email-template)] (concat [(i18n/label :t/report-bug-email-template)]
[separator [separator