Comments (11)
Hi, I raised the question around this in the Clojurians slack after running into this issue, and 6.0.2-SNAPSHOT has fixed it for me. Thanks for the (extremely) quick turnaround on this!
from timbre.
In the context of #354, using a global counter would also allow the change to also work for cljs
from timbre.
The likelihood of a ~64bit collision is small with the number of callsites, especially since the callsite id also incorporates other sources of entropy like the namespace, line, arg form, etc.
But a counter would indeed be simpler. This was a case of complexity growing organically over time :-)
The initial choice of rand was quick+simple. Then the issue of determinism came up, then the GraalVM issue related to the determinism fix.
It was helpful of Michiel to re-check the original purpose: a counter is definitely the better choice now that we know we want determinism 👍
from timbre.
Hi @borkdude Michiel, thanks so much for the clear report and solution! Apologies for the trouble.
Could you please confirm that [com.taoensso/timbre "6.0.2-SNAPSHOT"]
now works correctly on Graal?
Will deploy 6.0.2 final as soon as I get your confirmation.
Relatedly, it'd be great to get a Graal compile included in Timbre's tests (and in my other projects) but I've never used Graal myself. Would you maybe be able to point me in the direction of a good example of how to do this?
Cheers!
from timbre.
@dekelpilli Thanks a lot for the confirmation Dekel! Apologies for the trouble.
[com.taoensso/timbre "6.0.2"]
is now up on Clojars 👍
Will keep this issue open until we have some kind of Graal unit test included (or we rule out that possibility).
from timbre.
Fix looks good to me. Why was the random number needed in the log macro in the first place?
from timbre.
@borkdude Good question.
Basically we want a unique id for each logging call site (/ individual logging form).
These ids can be useful for rate-limiting, etc.
But the arguments for a logging form aren't necessarily unique, so to uniquely identify each form we can use something like a counter or random number/uuid/gensym/etc.
Hope that makes sense?
from timbre.
Yes. So a global counter would have been sufficient I guess. (rand)
or (.nextDouble ...)
can give you twice the same number (theoretically), a strictly increasing counter doesn't, although there the issue might be that eventually you will have to move to BigInteger: (inc' Long/MAX_VALUE)
from timbre.
Ah, logging call site: those are fairly limited, so I would not expect that to hit BigInteger ever :)
from timbre.
Thanks @ptaoussanis !
from timbre.
Closing this issue, but have opened #361 re: adding Graal tests.
from timbre.
Related Issues (20)
- Why are my Timbre timezones different than the system ones? HOT 3
- [shadow-cljs] Invalid :refer, var taoensso.encore/have does not exist HOT 26
- IllegalAccessException when logging internal JDK exception (SunCertPathBuilderException) via `log/error` HOT 13
- shadow-cljs: Advanced build bloated since 6.0.3 HOT 6
- Exception thrown when log arguments have same name, but different separators HOT 2
- Timbre crashing Cider workflow (?) HOT 9
- Using TAOENSSO_TIMBRE_CONFIG_EDN environment variable leads to an execption HOT 4
- Need some help/advice: No debug or info level logging, and duplicated message content HOT 10
- Add console appender opt to control `:raw-console?` HOT 1
- Link to Portal Timbre guide HOT 1
- Latest release uses older com.taoensso/encore; order-dependent if used with e.g. Tufte HOT 2
- API docs link from README results in 404 HOT 3
- Graal optimizations may break uberjar running HOT 6
- Seeing a lot of deprecation warnings in our log HOT 13
- Lots of Encore warnings HOT 3
- How to add appenders in the edn configuration? HOT 5
- Timbre v7
- Skipping a message for a specific appender HOT 6
- [TIMBRE WARNING]: `error-fn` failed, falling back to `pr-str` HOT 28
- how to use :min-level at the appender level based on namespace? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from timbre.