I'm following the guide on https://figwheel.org/docs/installation.html to get started with figwheel-main. I run
lein trampoline run -m figwheel.main
which works fine, BUT I get hundreds of DEBUG logg messages from org.eclipse.jetty.server in the terminal. How can I shut them off? I have tried putting org.eclipse.jetty.util.log.announce=false
in a jetty-logging.properties
file in the resources
directory and adding Dorg.eclipse.jetty.util.log.announce=false
to :jvm-opts
in project.clj. Neither works.I solved it! I edited logback.xml
.
morning all!
I was trying to trigger builds with figwheel and I noticed something quite weird, evaluating a function like
(defn build
[]
(with-config-overrides {:auth-disabled true}
(ig.repl/set-prep! (constantly automation-config))
(fm/build-once :automation)
(ig.repl/go)))
would actually log
Build id not found: automation
so the build runs even just by evaluating the function
which I can see also from
e2e.common> (macroexpand '(fm/build-once :automation))
Build id not found: automation
nil
and also strangely it never finds that build, but if I do (fm/start {:mode :build-once} "automation")
it works, even though it's still watches for changes, it doesn't do it only once
this lein run -m figwheel.main -- -bo automation
seems to be the only thing that behaves the way I would expect, it builds only once and then quits
@andrea.crotti yes the build-once command in the cljs repl is intended to take an available build and build it once
@andrea.crotti there should be a way to use fm/start
to build once without starting a watch process
but there should probably be a short hand for this
Yeah I'm in the clj repl, I'm using it to run smoke tests in ci, so it should build once and start jetty for example
But the question was also, how come it build-once seems to be doing something at macro expansion time?
And so I have to use start then right? I'll try to find the option to not make it watch then, I thought it was just mode: build-once like I tried but it wasn't enough
fm/build-once is intended only for use in the cljs-repl
Ah ok understood
its part of an api for interacting and modifying running builds
@andrea.crotti it could be that fm/start doesn’t handle build-once correctly. That is certainly possible. It’s a straightforward fix if it doesn’t
I add that to my list
ok thanks I'll check again
I mean I could use the lein command but it should work in the repl as well
@andrea.crotti absolutely
so looks like I was using start from figwheel.main instead of figwheel.main.api, but well it still starts the watcher as well if I call
(fma/start {:mode :build-once} :automation)
cool its on my list
thanks!
ah wait a moment, I had watch-dirs
set in that build config file
so well now it doesn't watch anything anymore. I guess it could still avoid watching if you pass build-once, but yeah it's kind of silly to have watch-dirs in the config anyway
so not a real bug probably
but btw should build-once
maybe not be in a cljs file instead of cljc?
its a macro 🙂
and it needs to be one as its a hack, the complier evals macros in the running clojure process
and thus we can reach the clojure process from the cljs repl
but it sure as heck should have some docs on it
uhm actually I take it back again, it doesn't watch now but it doesn't run the build once either, the process stays running
so yeah build-once is just not doing anything I guess
and the other thing is that I can't even do (fma/stop :automation)
if I started it with the build-once option, it says it wasn't registered, but if I do (fma/stop-all)
it kills it