This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-03-10
Channels
- # announcements (3)
- # asami (4)
- # babashka (21)
- # beginners (97)
- # calva (32)
- # cider (4)
- # clj-kondo (7)
- # cljdoc (1)
- # clojure (70)
- # clojure-europe (27)
- # clojure-nl (10)
- # clojure-norway (18)
- # clojure-uk (8)
- # clojure-ukraine (1)
- # clojurescript (5)
- # datalevin (7)
- # docker (1)
- # emacs (3)
- # fulcro (4)
- # girouette (4)
- # graalvm (2)
- # graphql (9)
- # gratitude (3)
- # honeysql (4)
- # hoplon (3)
- # hyperfiddle (7)
- # jobs (3)
- # kaocha (31)
- # lsp (23)
- # malli (7)
- # missionary (6)
- # nextjournal (9)
- # off-topic (6)
- # pathom (13)
- # polylith (13)
- # practicalli (3)
- # remote-jobs (3)
- # reveal (7)
- # schema (1)
- # sci (23)
- # shadow-cljs (31)
- # tools-deps (62)
- # xtdb (8)
I’ve extracted the trace code to an entirely new library: https://github.com/hlship/trace
Hi hlship! I’m interested in the trace library and have a question! 1. https://github.com/hlship/trace/blob/main/src/net/lewisship/trace.clj#L41 says we need to reload ns but https://github.com/hlship/trace/blob/main/src/net/lewisship/trace.clj#L48 is affected immediately. Is there any diffrence between two? 2. Plus, the problem I faced is I’d like to add trace https://github.com/green-labs/gosura/pull/63/files#diff-fdc1a1bab3cb05abb3c25796f6278f786704f20cf49750c1eee31d966105d9c1R195 and I setup default of trace in the other project(A project) I use that repo. but trace including sql doesn’t work on A project. How do I trace to exteral library using trace in my project using trace ??
trace is for your own code. You can add calls to trace
and it will build a useful map that it passed to Clojure's tap>
. In terms of reloading, the trace
macro has two modes: When not compiled, it is a no-op. When compilation is enabled, there's still a check against a global flag to see if tracing is enabled.
So in production code, you can leave in the trace
code but not set the compile flag, and your code is unaffected.
But when testing locally, you can set the compile flag before loading your namespaces and then turn tracing on and off globally as you work.
But for arbitrary third-party lib X, unless X uses trace and left that in their code, no luck.
Thank you for your replies. The first one is clear ! > But for arbitrary third-party lib X, unless X uses trace and left that in their code, no luck. But the second question is a bit confusing. In my case, my lib X which uses trace and left that in their code and my project A uses trace and lib X. So as I work for the project A and turn on tracing on to see lib X’s trace. but I can’t see any output of X’s trace even though trace is left in lib X.
Do I understand something wrong?