Skip to content

Commit

Permalink
[new] Give signal! a default kind and level
Browse files Browse the repository at this point in the history
  • Loading branch information
ptaoussanis committed Nov 1, 2024
1 parent dc4b13d commit 22923a8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions projects/main/resources/signal-docstrings/signal!.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Low-level generic signal creator.

API: [opts] => depends on options [2]
Default kind: none (optional)
Default level: none (must be provided)
Default kind: `:default`
Default level: `:info`

When filtering conditions are met [4], creates a Telemere signal [3] and
dispatches it to registered handlers for processing (e.g. writing to
Expand Down
4 changes: 2 additions & 2 deletions projects/main/src/taoensso/telemere/impl.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -560,8 +560,8 @@
:arglists (signal-arglists :signal!)}
[opts]
(have? map? opts) ; We require const map keys, but vals may require eval
(let [defaults (get opts :defaults)
opts (merge defaults (dissoc opts :defaults))
(let [defaults (enc/merge {:kind :default, :level :info} (get opts :defaults))
opts (enc/merge defaults (dissoc opts :defaults))
cljs? (boolean (:ns &env))
clj? (not cljs?)
{run-form :run} opts
Expand Down

0 comments on commit 22923a8

Please sign in to comment.