figwheel-main

figwheel-main http://figwheel.org
Empperi 2019-03-25T12:43:42.075Z

Is there any way to silence the jetty used by Figwheel Main? I have a serious problem with it since I have a following combo in use: • Figwheel Main • Timbre • Timbre's slf4j adapter

Empperi 2019-03-25T12:44:53.076Z

Now if I execute for example lein run -m figwheel.main -co test.cljs.edn -m my-runner it will end up starting Jetty under the hood so that it can do it's magic

Empperi 2019-03-25T12:45:58.077300Z

BUT since I have both Timbre and it's slf4j adapter which get loaded during classload (since that's just it has to be done with java logging stuff) and Timbre defaults to :debug level (like pretty much all loggers) this will end up putting Jetty to debug level which causes shitton of log

Empperi 2019-03-25T12:46:25.077700Z

Just executed a build, caused 20877 lines of logs

Empperi 2019-03-25T12:46:54.078Z

all lines from org.eclipse.jetty

Empperi 2019-03-25T12:49:32.080200Z

These are the only solutions I've came up with so far to remedy this problem: 1) Use env variable and set logging level through that. This is a bad solution though since it is totally dependent on the system which is executing the command. I would want to avoid this as long as possible 2) Write a separate Leiningen plugin which calls Figwheel Main under the hood AND allows silencing Jetty before starting it

conan 2019-03-29T17:08:02.000500Z

i'd have thought you could blacklist the jetty namespaces using timbre's configuration https://github.com/ptaoussanis/timbre#configuration

conan 2019-03-29T17:08:41.000800Z

you can blacklist specific namespaces, e.g. :ns-blacklist ["*jetty.*"]

conan 2019-03-29T17:08:47.001Z

(or something like that)

conan 2019-03-29T17:09:44.001200Z

you can add that into timbre dynamically with timbre/merge-config!, something like

(timbre/merge-config! {:ns-blacklist  ["*.jetty.*"]})

conan 2019-03-29T17:11:31.001700Z

maybe give that a shot? note that you can actually write your own appender functions to filter messages (or do anything else), so you could drop in a function that says "if it's jetty and doesn't include the word Exception then ignore"

Empperi 2019-04-01T08:11:30.002400Z

Sorry that I didn't respond earlier. I did naturally try the blacklisting. The problem here is, that the logging happens without me having any control over the logging configurations. I ended up "fixing" this problem by including the slf4j adapter only in uberjar profile

Empperi 2019-03-25T12:49:44.080600Z

Both solutions are very much not what I want

Empperi 2019-03-25T13:31:41.080800Z

Made an issue out of this https://github.com/bhauman/figwheel-main/issues/162