mirror of
https://github.com/status-im/status-react.git
synced 2025-02-16 21:07:21 +00:00
set log level from .env configuration
This commit is contained in:
parent
777c9d04bc
commit
3d89143d72
1
.env
1
.env
@ -4,3 +4,4 @@ DEBUG_LOGS_ENABLED=1
|
|||||||
STUB_STATUS_GO=0
|
STUB_STATUS_GO=0
|
||||||
ETHEREUM_DEV_CLUSTER=1
|
ETHEREUM_DEV_CLUSTER=1
|
||||||
MAINNET_NETWORKS_ENABLED=1
|
MAINNET_NETWORKS_ENABLED=1
|
||||||
|
LOG_LEVEL=debug
|
||||||
|
@ -4,3 +4,4 @@ DEBUG_LOGS_ENABLED=1
|
|||||||
STUB_STATUS_GO=0
|
STUB_STATUS_GO=0
|
||||||
ETHEREUM_DEV_CLUSTER=1
|
ETHEREUM_DEV_CLUSTER=1
|
||||||
MAINNET_NETWORKS_ENABLED=1
|
MAINNET_NETWORKS_ENABLED=1
|
||||||
|
LOG_LEVEL=debug
|
||||||
|
@ -4,3 +4,4 @@ DEBUG_LOGS_ENABLED=0
|
|||||||
STUB_STATUS_GO=0
|
STUB_STATUS_GO=0
|
||||||
ETHEREUM_DEV_CLUSTER=0
|
ETHEREUM_DEV_CLUSTER=0
|
||||||
MAINNET_NETWORKS_ENABLED=0
|
MAINNET_NETWORKS_ENABLED=0
|
||||||
|
LOG_LEVEL=info
|
||||||
|
@ -12,7 +12,8 @@
|
|||||||
[status-im.utils.error-handler :as error-handler]
|
[status-im.utils.error-handler :as error-handler]
|
||||||
[status-im.utils.utils :as utils]
|
[status-im.utils.utils :as utils]
|
||||||
[status-im.utils.config :as config]
|
[status-im.utils.config :as config]
|
||||||
[status-im.utils.notifications :as notifications]))
|
[status-im.utils.notifications :as notifications]
|
||||||
|
[status-im.core :as core]))
|
||||||
|
|
||||||
(defn init-back-button-handler! []
|
(defn init-back-button-handler! []
|
||||||
(let [new-listener (fn []
|
(let [new-listener (fn []
|
||||||
@ -79,9 +80,6 @@
|
|||||||
:reagent-render views/main})))
|
:reagent-render views/main})))
|
||||||
|
|
||||||
(defn init []
|
(defn init []
|
||||||
(error-handler/register-exception-handler!)
|
|
||||||
(status/init-jail)
|
|
||||||
(.registerComponent react/app-registry "StatusIm" #(reagent/reactify-component app-root))
|
|
||||||
(status/set-soft-input-mode status/adjust-resize)
|
(status/set-soft-input-mode status/adjust-resize)
|
||||||
(init-back-button-handler!)
|
(init-back-button-handler!)
|
||||||
(dispatch-sync [:initialize-app]))
|
(core/init app-root))
|
||||||
|
15
src/status_im/core.cljs
Normal file
15
src/status_im/core.cljs
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
(ns status-im.core
|
||||||
|
(:require [status-im.utils.error-handler :as error-handler]
|
||||||
|
[status-im.ui.components.react :as react]
|
||||||
|
[re-frame.core :as re-frame]
|
||||||
|
[reagent.core :as reagent]
|
||||||
|
[status-im.native-module.core :as status]
|
||||||
|
[taoensso.timbre :as log]
|
||||||
|
[status-im.utils.config :as config]))
|
||||||
|
|
||||||
|
(defn init [app-root]
|
||||||
|
(log/set-level! config/log-level)
|
||||||
|
(error-handler/register-exception-handler!)
|
||||||
|
(status/init-jail)
|
||||||
|
(.registerComponent react/app-registry "StatusIm" #(reagent/reactify-component app-root))
|
||||||
|
(re-frame/dispatch-sync [:initialize-app]))
|
@ -12,7 +12,8 @@
|
|||||||
[status-im.utils.error-handler :as error-handler]
|
[status-im.utils.error-handler :as error-handler]
|
||||||
[status-im.utils.utils :as utils]
|
[status-im.utils.utils :as utils]
|
||||||
[status-im.utils.config :as config]
|
[status-im.utils.config :as config]
|
||||||
[status-im.utils.notifications :as notifications]))
|
[status-im.utils.notifications :as notifications]
|
||||||
|
[status-im.core :as core]))
|
||||||
|
|
||||||
(defn orientation->keyword [o]
|
(defn orientation->keyword [o]
|
||||||
(keyword (.toLowerCase o)))
|
(keyword (.toLowerCase o)))
|
||||||
@ -53,7 +54,4 @@
|
|||||||
:reagent-render views/main})))
|
:reagent-render views/main})))
|
||||||
|
|
||||||
(defn init []
|
(defn init []
|
||||||
(error-handler/register-exception-handler!)
|
(core/init app-root))
|
||||||
(status/init-jail)
|
|
||||||
(.registerComponent react/app-registry "StatusIm" #(reagent/reactify-component app-root))
|
|
||||||
(dispatch-sync [:initialize-app]))
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
(ns status-im.utils.config
|
(ns status-im.utils.config
|
||||||
(:require [status-im.react-native.js-dependencies :as rn-dependencies]))
|
(:require [status-im.react-native.js-dependencies :as rn-dependencies]
|
||||||
|
[clojure.string :as string]))
|
||||||
|
|
||||||
(def config (js->clj (.-default rn-dependencies/config) :keywordize-keys true))
|
(def config (js->clj (.-default rn-dependencies/config) :keywordize-keys true))
|
||||||
|
|
||||||
@ -20,4 +21,8 @@
|
|||||||
(def notifications-wip-enabled? (enabled? (get-config :NOTIFICATIONS_WIP_ENABLED 0)))
|
(def notifications-wip-enabled? (enabled? (get-config :NOTIFICATIONS_WIP_ENABLED 0)))
|
||||||
(def stub-status-go? (enabled? (get-config :STUB_STATUS_GO 0)))
|
(def stub-status-go? (enabled? (get-config :STUB_STATUS_GO 0)))
|
||||||
(def mainnet-networks-enabled? (enabled? (get-config :MAINNET_NETWORKS_ENABLED 0)))
|
(def mainnet-networks-enabled? (enabled? (get-config :MAINNET_NETWORKS_ENABLED 0)))
|
||||||
|
(def log-level
|
||||||
|
(-> (get-config :LOG_LEVEL "error")
|
||||||
|
string/lower-case
|
||||||
|
keyword))
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user