From b6ec73210c9254156c83fe56c70fbea2a59affae Mon Sep 17 00:00:00 2001 From: Antonin Hildebrand Date: Tue, 17 May 2016 22:08:32 +0200 Subject: [PATCH] runtime: silence "No such namespace ..." warnings by default --- src/runtime/dirac/runtime/prefs.clj | 4 +++- src/runtime/dirac/runtime/prefs.cljs | 3 ++- src/runtime/dirac/runtime/repl.cljs | 1 + 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/runtime/dirac/runtime/prefs.clj b/src/runtime/dirac/runtime/prefs.clj index ffb6b2eac2..41d7f16a1c 100644 --- a/src/runtime/dirac/runtime/prefs.clj +++ b/src/runtime/dirac/runtime/prefs.clj @@ -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) "*"))] @@ -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))) \ No newline at end of file + (static-pref :silence-use-of-undeclared-var-warnings :boolean) + (static-pref :silence-no-such-namespace-warnings :boolean))) \ No newline at end of file diff --git a/src/runtime/dirac/runtime/prefs.cljs b/src/runtime/dirac/runtime/prefs.cljs index 2cb1679f47..47fd65a3cb 100644 --- a/src/runtime/dirac/runtime/prefs.cljs +++ b/src/runtime/dirac/runtime/prefs.cljs @@ -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 diff --git a/src/runtime/dirac/runtime/repl.cljs b/src/runtime/dirac/runtime/repl.cljs index d2b7187fa0..a6f88978db 100644 --- a/src/runtime/dirac/runtime/repl.cljs +++ b/src/runtime/dirac/runtime/repl.cljs @@ -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]