Skip to content
Snippets Groups Projects
Commit 7e682001 authored by Thomas Bock's avatar Thomas Bock :speech_balloon:
Browse files

facility

parent 9811ce03
No related branches found
No related tags found
No related merge requests found
...@@ -19,3 +19,9 @@ ...@@ -19,3 +19,9 @@
* Valid values: `9009`, `55555`, ... * Valid values: `9009`, `55555`, ...
* Set Example: `export DEVHUB_IP=55555` * Set Example: `export DEVHUB_IP=55555`
* Default value: `9009` * Default value: `9009`
## `"DEVHUB_FACILITY"`
* Valid values: any string
* Set Example: `export DEVHUB_FACILITY="SE3"`
* Default value: none
logo.png

19.4 KiB | W: | H:

logo.png

6.24 KiB | W: | H:

logo.png
logo.png
logo.png
logo.png
  • 2-up
  • Swipe
  • Onion skin
{ {:log-context {:app-name "devhub"}
:mulog {:type :multi :mulog {:type :multi
;; send events to the stdout ;; send events to the stdout
:console {:type :console :console {:type :console
......
...@@ -20,6 +20,11 @@ ...@@ -20,6 +20,11 @@
[:mulog :publishers] [:mulog :publishers]
(if (= e :off) [] [(get-in conf [:mulog e] d)])))) (if (= e :off) [] [(get-in conf [:mulog e] d)]))))
(defn log-context [ conf]
(if-let [s (System/getenv "DEVHUB_FACILITY")]
(assoc-in conf [:log-context :facility] s)
conf))
(defn ip [conf] (defn ip [conf]
(if-let [e (System/getenv "DEVHUB_IP")] (if-let [e (System/getenv "DEVHUB_IP")]
(assoc-in conf [:server :ip] e) (assoc-in conf [:server :ip] e)
...@@ -36,4 +41,4 @@ ...@@ -36,4 +41,4 @@
(defn stub-mode [conf] (get-in conf [:stub :mode])) (defn stub-mode [conf] (get-in conf [:stub :mode]))
(defn config [] (-> (get-conf) log-type ip port )) (defn config [] (-> (get-conf) log-type log-context ip port ))
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
(:require [compojure.route :as route] (:require [compojure.route :as route]
[devhub.config :as c] [devhub.config :as c]
[devhub.utils :as u] [devhub.utils :as u]
[clojure.pprint :as pprint]
[devhub.pp :as pp] [devhub.pp :as pp]
[devhub.pp-js :as js] [devhub.pp-js :as js]
[devhub.pp-py :as py] [devhub.pp-py :as py]
...@@ -132,9 +133,8 @@ ...@@ -132,9 +133,8 @@
middleware/wrap-json-response)) middleware/wrap-json-response))
(defn init-log! (defn init-log!
[{conf :mulog }] [{conf :mulog ctx :log-context}]
(mu/set-global-context! (mu/set-global-context! ctx)
{:app-name "devhub" :version (:version (u/version))})
(mu/start-publisher! conf)) (mu/start-publisher! conf))
(def server (atom nil)) (def server (atom nil))
...@@ -157,6 +157,6 @@ ...@@ -157,6 +157,6 @@
(reset! server (run-server #'app (:server conf))))) (reset! server (run-server #'app (:server conf)))))
(defn -main [& args] (defn -main [& args]
(println (c/config)) (pprint/pprint (c/config))
(u/ascii-logo) (u/ascii-logo)
(start)) (start))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment