Closed johanatan closed 2 months ago
@johanatan Hi Johanatan, I'm about to get some sleep and currently without a REPL to check your example. Will need to look closer tomorrow to be sure, but at least nothing stands out as obviously wrong with your example.
In case it's helpful in the meantime, here's a shorter example:
(tel/with-handler ::my-handler println {:kind-filter {:allow :my-kind}}
(tel/signal! {:kind :my-kind, :level :info})) ; Should print signals iff `{:kind :my-kind}`
(tel/with-handler ::my-handler println {:kind-filter {:disallow :my-kind}}
(tel/signal! {:kind :my-kind, :level :info})) ; Should print signals iff NOT `{:kind :my-kind}`
also, strangely get-handlers-stats is returning NULL always.
That is strange, I can't think of any obvious reason that'd be the case. Is get-handlers
returning what you expect?
yea that's not working here.
and get-handlers-stats seems to be returning null because the two handlers have track-stats?
set to false
despite the documentation saying that it should default to true
.
here is the result of running (t/get-handlers)
:
{:postgres {:dispatch-opts {:priority 100, :track-stats? false, :kind-filter {:disallow :trace}}, :handler-fn #object[options$logging$handler_COLON_postgres_handler_$_handler_COLON_postgres_handler]},
:postgres-tracer {:dispatch-opts {:priority 100, :track-stats? false, :kind-filter {:allow :trace}}, :handler-fn #object[options$logging$handler_COLON_postgres_trace_handler_$_handler_COLON_postgres_trace_handler]}}
notice that the kind-filters are specified properly but they are both having no effect. both 'trace' and 'log' are going to the :postgres handler.
And to confirm- you're for sure running the latest version of Telemere (currently beta 22)?
Could you share what values you have for the following?:
taoensso.encore/encore-version
taoensso.encore.signals/default-handler-dispatch-opts
yea that's not working here.
Interesting, these both work on my side. Will try investigate later today once you've confirmed that you're on beta 22 👍
I'm on beta 14 actually. I'll try with 22 and get back to you.
Okay, that's the likely source of the trouble then. Please make sure that you're always on the latest beta to ensure that you've got all the latest fixes and features.
In case it's helpful, you can use something like lein-ancient or GitHub's watch feature to be notified of new releases:
Okay. Thanks. Sorry about that. This was indeed the issue.
Btw, I prefer tools.deps over lein but I did sign up for the GitHub watch.
Okay. Thanks. Sorry about that. This was indeed the issue.
No worries, happy to hear everything's working 👍
given this code, all the :trace signals are going to the wrong handler. also, strangely
get-handlers-stats
is returning NULL always.