 
 (defn find-ns-sym
   [file]
-  (println file)
   (some->> file
            slurp
            (re-find #"\(ns\s+(.+)\b")


(defn ^:nrepl sayid-trace-fn-enable
  [{:keys [transport fn-name fn-ns] :as msg}]
  (println "**** sayid-trace-fn-enable")
  (println (util/qualify-sym fn-ns fn-name))
  (sd/ws-enable-trace-fn! (util/qualify-sym fn-ns fn-name))
  (send-status-done msg))

(defn ^:nrepl sayid-trace-fn-disable
  [{:keys [transport fn-name fn-ns] :as msg}]
  (println "**** sayid-trace-fn-disable")
  (println (util/qualify-sym fn-ns fn-name))
  (sd/ws-disable-trace-fn! (util/qualify-sym fn-ns fn-name))
  (send-status-done msg))

(defn ^:nrepl sayid-trace-fn-remove
  [{:keys [transport fn-name fn-ns] :as msg}]
  (println "**** sayid-trace-fn-remove")
  (println (util/qualify-sym fn-ns fn-name))
  (sd/ws-remove-trace-fn! (util/qualify-sym fn-ns fn-name))
  (send-status-done msg))

(defn ^:nrepl sayid-replay-workspace
  [{:keys [transport] :as msg}]
  (println "sayid-replay-workspace")
  (let [kids (:children (sd/ws-deref!))]
    (sd/ws-cycle-all-traces!)
    (sd/ws-clear-log!)


(defn ^:nrepl sayid-trace-ns-in-file
  [{:keys [transport file] :as msg}]
  (->> file
       find-ns-sym
       sd/ws-add-trace-ns!*)
  (send-status-done msg))

