Comments (13)
@finalfantasia Hi Salam, thanks for letting me know about this.
It seems that Shadow-CLJS is warning about the use of deprecated vars, even by other deprecated vars. That seems wrong to me, especially since it seems to include warnings about a deprecated var calling itself with a different arity.
Anyway, depending on what other Taoensso libs you're using - it may be possible to eliminate the warnings with one of the following:
- Set the
taoensso.elide-deprecated
JVM property to "true", or - Set the
TAOENSSO_ELIDE_DEPRECATED
ENV var to "true"
One easy way to do (1) is by adding a :jvm-opts ["-Dtaoensso.elide-deprecated=true"]
key to your Leiningen project.clj or equivalent.
That'll cause all deprecated Taoensso vars to be completely elided at compile-time.
Please let me know if that helps, otherwise I'll see about filing an issue against Shadow-CLJS since I suspect that the current behaviour isn't intentional.
from timbre.
we were able to suppress these warnings by disabling a ClojureScript compiler flag (:fn-deprecated) in our shadow-cljs.edn
Thank you @finalfantasia! 🤓
EDIT: Please see this comment below for the recommended fix.
from timbre.
Thanks Chris, Salam! 👍
Though just a heads-up that completely disabling deprecated var warnings might not be something you want long-term. It's easy to forget about, and could cause you to miss important warnings later.
Ideally the irrelevant warnings should be stopped upstream, Eric created a shadow-cljs issue here.
And in case there's still any bothersome Encore warnings after that (and after updating your Taoensso dependencies), you could selectively suppress any remaining warnings with the method I mentioned above.
I believe that might also be a safer choice in the meantime (while waiting for a possible shadow-cljs fix) since it's more selective.
from timbre.
Though just a heads-up that completely disabling deprecated var warnings might not be something you want long-term. It's easy to forget about, and could cause you to miss important warnings later.
Here is what an example shadow-cljs.edn
file might look like with the JVM option set:
{:dependencies [...]
:source-paths [...]
:jvm-opts ["-Dtaoensso.elide-deprecated=true"]
:builds
{:app {:target :browser
:output-dir "public/assets/app/js"
:asset-path "/assets/app/js"
:modules {:main {:entries [my.app]}}}}}
from timbre.
Closing, should now be resolved with https://github.com/taoensso/timbre/releases/tag/v6.4.0.
Again, apologies for all the noise on this issue.
from timbre.
@ptaoussanis could be related to this 6 years old issue that will likely never be fixed. The workaround could be to add ^:deprecation-nowarn
as mentionned in the issue https://clojure.atlassian.net/browse/CLJS-2000
from timbre.
@finalfantasia Hi Salam, thanks for letting me know about this.
It seems that Shadow-CLJS is warning about the use of deprecated vars, even by other deprecated vars. That seems wrong to me, especially since it seems to include warnings about a deprecated var calling itself with a different arity.
Anyway, depending on what other Taoensso libs you're using - it may be possible to eliminate the warnings with one of the following:
Set the
taoensso.elide-deprecated
JVM property to "true", orSet the
TAOENSSO_ELIDE_DEPRECATED
ENV var to "true"One easy way to do (1) is by adding a
:jvm-opts ["-Dtaoensso.elide-deprecated=true"]
key to your Leiningen project.clj or equivalent.That'll cause all deprecated Taoensso vars to be completely elided at compile-time.
Please let me know if that helps, otherwise I'll see about filing an issue against Shadow-CLJS since I suspect that the current behaviour isn't intentional.
Will do. Thanks for the prompt response!
from timbre.
Closing this issue as we were able to suppress these warnings by disabling a ClojureScript compiler flag (:fn-deprecated
) in our shadow-cljs.edn
from timbre.
Re-opening until the shadow-cljs issue is fixed.
For anyone running into this in the meantime, please see here for the recommended workaround.
Sorry for the trouble!
from timbre.
@ptaoussanis That fix doesn't work with at least Encore 3.74.1 and Timbre 6.3.1 because the latter relies on enc/limiter
, which is deprecated.
from timbre.
@p-himik Thanks for the heads-up Eugene 🙏
@everyone I've just pushed Encore v3.74.2 to Clojars that just removes the deprecation metadata in the meantime until shadow-cljs can be fixed.
Again apologies for all the trouble on this.
from timbre.
@ptaoussanis actually it is not an issue in shadow-cljs but in clojurescript itself:
deps.edn
{:deps {org.clojure/clojurescript {:mvn/version "1.11.54"}
com.taoensso/timbre {:mvn/version "6.3.1"}
}}
src/hello_world/core.cljs
(ns hello-world.core
(:require [taoensso.timbre :as log]))
(log/info "Hello")
(println "Hello world!")
yenda@project2503:~/test-warning$ clj -M -m cljs.main -c hello-world.core
WARNING: taoensso.encore/compile-ns-filter is deprecated at line 6125 /home/yenda/.cljs/.aot_cache/1.11.54/02F6365/taoensso/encore.cljc
WARNING: taoensso.encore/rate-limiter* is deprecated at line 6202 /home/yenda/.cljs/.aot_cache/1.11.54/02F6365/taoensso/encore.cljc
WARNING: taoensso.encore/rate-limiter* is deprecated at line 6209 /home/yenda/.cljs/.aot_cache/1.11.54/02F6365/taoensso/encore.cljc
WARNING: taoensso.encore/rate-limiter* is deprecated at line 6211 /home/yenda/.cljs/.aot_cache/1.11.54/02F6365/taoensso/encore.cljc
WARNING: taoensso.encore/distinctv is deprecated at line 6266 /home/yenda/.cljs/.aot_cache/1.11.54/02F6365/taoensso/encore.cljc
WARNING: taoensso.encore/-swap-val! is deprecated at line 6306 /home/yenda/.cljs/.aot_cache/1.11.54/02F6365/taoensso/encore.cljc
WARNING: taoensso.encore/sub-indexes is deprecated at line 6334 /home/yenda/.cljs/.aot_cache/1.11.54/02F6365/taoensso/encore.cljc
WARNING: taoensso.encore/sub-indexes is deprecated at line 6343 /home/yenda/.cljs/.aot_cache/1.11.54/02F6365/taoensso/encore.cljc
WARNING: taoensso.encore/sentinel? is deprecated at line 6349 /home/yenda/.cljs/.aot_cache/1.11.54/02F6365/taoensso/encore.cljc
WARNING: taoensso.encore/singleton? is deprecated at line 6352 /home/yenda/.cljs/.aot_cache/1.11.54/02F6365/taoensso/encore.cljc
from timbre.
@yenda Thanks for investigating Eric! I'll add the suggested workaround to the next Encore release. Much appreciated! Cheers :-)
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
- 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.