Skip to content

Commit

Permalink
runtime: silence "No such namespace ..." warnings by default
Browse files Browse the repository at this point in the history
  • Loading branch information
darwin committed May 17, 2016
1 parent 222f867 commit b6ec732
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/runtime/dirac/runtime/prefs.clj
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
(def ^:dynamic *eval-time-limit* (env :dirac-eval-time-limit))
(def ^:dynamic *runtime-tag* (or (env :dirac-runtime-tag) (attempt-to-determine-runtime-tag)))
(def ^:dynamic *silence-use-of-undeclared-var-warnings* (env :dirac-silence-use-of-undeclared-var-warnings))
(def ^:dynamic *silence-no-such-namespace-warnings* (env :dirac-silence-no-such-namespace-warnings))

(defmacro static-pref [key kind]
(let [sym (symbol (str "*" (name key) "*"))]
Expand All @@ -67,4 +68,5 @@
(static-pref :context-availablity-next-trial-waiting-time :int)
(static-pref :eval-time-limit :int)
(static-pref :runtime-tag :str)
(static-pref :silence-use-of-undeclared-var-warnings :boolean)))
(static-pref :silence-use-of-undeclared-var-warnings :boolean)
(static-pref :silence-no-such-namespace-warnings :boolean)))
3 changes: 2 additions & 1 deletion src/runtime/dirac/runtime/prefs.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
:eval-time-limit 10000
:java-trace-header-style "color:red"
:runtime-tag "unidentified"
:silence-use-of-undeclared-var-warnings true})
:silence-use-of-undeclared-var-warnings true
:silence-no-such-namespace-warnings true})

(def static-prefs (gen-static-prefs)) ; this config is comming from environment and system properties

Expand Down
1 change: 1 addition & 0 deletions src/runtime/dirac/runtime/repl.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@
(defn should-silence-warning? [message]
(cond
(and (pref :silence-use-of-undeclared-var-warnings) (re-find #"^Use of undeclared Var" message)) true
(and (pref :silence-no-such-namespace-warnings) (re-find #"^No such namespace" message)) true
:else false))

(defn should-silence-error? [_message]
Expand Down

0 comments on commit b6ec732

Please sign in to comment.