Skip to content

Commit

Permalink
[mod] Default signal-content-fn: omit redundant parent/root id namesp…
Browse files Browse the repository at this point in the history
…aces
  • Loading branch information
ptaoussanis committed Nov 12, 2024
1 parent dc995e9 commit 82368d3
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions projects/main/src/taoensso/telemere/utils.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,11 @@

(comment ((signal-preamble-fn) (tel/with-signal (tel/event! ::ev-id))))

(defn- format-parent [ns {:keys [id uid]}]
{:id (symbol (sigs/format-id ns id)) :uid uid})

(comment (str (format-parent (str *ns*) {:id ::foo})))

(defn signal-content-fn
"Experimental, subject to change.
Returns a (fn content [signal]) that:
Expand Down Expand Up @@ -589,10 +594,10 @@
(when uid (af " uid: " (vf uid)))
(when parent
(if (= parent root)
(do (af " parent: " (vf (dissoc parent :inst)) " (also root)")) ; {:keys [id uid]}
(do (af " parent: " (vf (format-parent ns parent)) " (also root)")) ; {:keys [id uid]}
(do
(do (af " parent: " (vf (dissoc parent :inst)))) ; {:keys [id uid]}
(when root (af " root: " (vf (dissoc root :inst))))))) ; {:keys [id uid]}
(do (af " parent: " (vf (format-parent ns parent)))) ; {:keys [id uid]}
(when root (af " root: " (vf (format-parent ns root))))))) ; {:keys [id uid]}

#?(:clj (when (enc/and* host incl-host?) (af " host: " (vf host)))) ; {:keys [ name ip]}
#?(:clj (when (enc/and* thread incl-thread?) (af " thread: " (vf thread)))) ; {:keys [group name id]}
Expand Down

0 comments on commit 82368d3

Please sign in to comment.