Skip to content

Commit

Permalink
[fix] pr-signal-fn: wasn't realizing delayed messages
Browse files Browse the repository at this point in the history
Thanks to @denismc for the report!
  • Loading branch information
ptaoussanis committed May 10, 2024
1 parent ec92808 commit cf72017
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/taoensso/telemere/utils.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -614,6 +614,7 @@
(let [not-map? (not (map? signal))
signal (if (or incl-kvs? not-map?) signal (dissoc signal :kvs))
signal (if (or incl-thread? not-map?) signal (dissoc signal :thread))
signal (if not-map? signal (force-signal-msg signal))
signal (if prep-fn (prep-fn signal) signal)
output (pr-fn signal)]

Expand Down
4 changes: 3 additions & 1 deletion test/taoensso/telemere_tests.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,7 @@
(is (string? (re-find #"taoensso.telemere-tests\(\d+,\d+\)" preamble)))]))

(testing "pr-signal-fn"
(let [sig (with-sig (tel/event! ::ev-id {:inst t0}))]
(let [sig (with-sig :raw :trap (tel/event! ::ev-id {:inst t0, :msg ["a" "b"]}))]

[(testing ":edn"
(let [sig (update sig :inst enc/inst->udt)
Expand All @@ -702,6 +702,7 @@
(enc/submap? sig*1
{:schema 1, :kind :event, :id ::ev-id, :level :info,
:ns "taoensso.telemere-tests"
:msg_ "a b"
:inst udt0
:line pnat-int?
:column pnat-int?}))]))
Expand All @@ -713,6 +714,7 @@
(enc/submap? sig*
{"schema" 1, "kind" "event", "id" "taoensso.telemere-tests/ev-id",
"level" "info", "ns" "taoensso.telemere-tests"
"msg_" "a b"
"inst" t0s
"line" pnat-int?
"column" pnat-int?})))))
Expand Down

0 comments on commit cf72017

Please sign in to comment.