Merge pull request #395 from saskali/warning-on-tracing-not-set

Log warning when tracing not enabled
This commit is contained in:
Daniel Compton 2017-08-14 20:30:16 +12:00 committed by GitHub
commit c43192f006

View File

@ -27,7 +27,9 @@
"Registers a tracing callback function which will receive a collection of one or more traces. "Registers a tracing callback function which will receive a collection of one or more traces.
Will replace an existing callback function if it shares the same key." Will replace an existing callback function if it shares the same key."
[key f] [key f]
(swap! trace-cbs assoc key f)) (if trace-enabled?
(swap! trace-cbs assoc key f)
(console :warn "Tracing is not enabled. Please set {\"re_frame.trace.trace_enabled_QMARK_\" true} in :closure-defines. See: https://github.com/Day8/re-frame-trace#installation.")))
(defn remove-trace-cb [key] (defn remove-trace-cb [key]
(swap! trace-cbs dissoc key) (swap! trace-cbs dissoc key)