Skip to content

Commit

Permalink
Add logging to zen.cli/build-ftr
Browse files Browse the repository at this point in the history
Co-authored-by: KGOH <kgofhedgehogs@gmail.com>
  • Loading branch information
ApricotLace and KGOH committed Dec 22, 2022
1 parent f050d19 commit b78d7f2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/ftr/zen_cli.clj
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
(assoc "build-ftr" (fn [opts]
(let [ztx (zen.cli/load-ztx opts)]
(zen.cli/load-used-namespaces ztx #{})
(ftr.zen-package/build-ftr ztx))))
(ftr.zen-package/build-ftr ztx {:enable-logging? true}))))
(assoc "get-ftr-index-info" ftr.zen-package/get-ftr-index-info)))


Expand Down
6 changes: 4 additions & 2 deletions src/ftr/zen_package.clj
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,17 @@
(:import (java.util UUID)))


(defn build-ftr [ztx]
(defn build-ftr [ztx & [{:as opts, :keys [enable-logging?]}]]
(let [syms (zen.core/get-tag ztx 'zen.fhir/value-set)
value-sets (map (partial zen.core/get-symbol ztx) syms)
ftr-configs (->> value-sets
(group-by :ftr)
keys
(filter identity))]
(doseq [ftr ftr-configs]
(ftr.core/apply-cfg {:cfg ftr}))))
(ftr.core/apply-cfg (cond-> {:cfg ftr}
enable-logging?
(assoc :ftr.utils.unifn.core/tracers [:ftr.logger.core/dispatch-logger]))))))


(defn expand-zen-packages [path]
Expand Down

0 comments on commit b78d7f2

Please sign in to comment.