This is a BREAKING change for the small minority of users that:
1. Are using the `taoensso.telemere.slf4j` backend, AND
2. Are using the low-level `:slf4j/args` or `:slf4j/marker-names`
values in signal `:data`
BEFORE this commit:
SLF4J signals contain:
{:data {:slf4j/kvs {...},
:slf4j/args [...],
:slf4j/marker-names #{...}},
...}.
AFTER this commit:
SLF4J signals contain:
{:data {:slf4j/kvs {...}},
:kvs {:slf4j/args <Object[]>,
:slf4j/markers #{...}},
...}
So:
- [:data :slf4j/marker-names] has moved to [:kvs :slf4j/markers].
- [:data :slf4j/args] has moved to [:kvs :slf4j/args],
and is now an Object[] rather than vector.
Motivation for the change:
The new behaviour is a more sensible default.
Basically: anything in `:data` is included by default in output.
But :slf4j/args are generally anyway already in the signal's formatted
message, so this ends up just creating duplicate output.
Likewise markers are generally used more for filtering/xfns than for
output labelling, so excluding them from default output is sensible.
This is the input-side change related to [1], and only
affects folks who've been providing custom callsite info to
Telemere signals (usually in the context of wrapper macros).
To provide custom callsite info BEFORE this commit:
(tel/signal! {:location {:ns "my-ns", :line 10, :column 20}})
To provide custom callsite info AFTER this commit:
(tel/signal! {:ns "my-ns", :coords [10 20]})
Motivation for the new override API:
- It's shorter and cleaner.
- It's less likely to cause confusion since it avoids the
redundant signal keys (signals previously contained callsite
info in 2 duplicate places).
- The underlying implementation is simpler.
- The util for manually getting coords is easier to use and doesn't
require macro-time environment info, making it easier for folks
to write wrapper macros that include line + column info.
- When embedded, the new callsite info is shorter and easier for
Cljs advanced compilation to de-duplicate (so helps reduce .js
build size).
[1] Commit 1f99f7186b
Incl.:
1. Logger names are now used as namespaces.
- For SLF4J: these are typically class names.
- For tools.logging: these are typically *ns* strings.
2. These now have dedicated :kind (:slf4j, :tools.logging) to make it
easier for users to set kind-specific min levels.
Thanks to @AdamFrey for reporting this issue!
Ref. <https://clojurians.slack.com/archives/C06ALA6EEUA/p1713805333272469>
Previously:
Attempting to run AOT'd code using Telemere would result in errors like:
"Attempting to call unbound fn: #'taoensso.telemere.handlers.open-telemetry/handler:open-telemetry-logger"
The approach I was using of conditionally requiring namespaces and then aliasing vars seems to be inherently
fragile under AOT, and was leading to the remote source var being unbound.
With this commit I've now switched to a simpler approach - where we conditionally require namespaces *without*
the need for any aliasing.