Skip to content

Commit

Permalink
Configure figwheel's logging
Browse files Browse the repository at this point in the history
Figwheel logs in an unusal way, this reconfigure's it to be more
sensible.  In particular, this reduces the verbosity significantly.
  • Loading branch information
SevereOverfl0w committed Nov 23, 2018
1 parent 4fbf081 commit 3688e66
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib.app.dev/src/dev_extras.clj
Expand Up @@ -13,6 +13,16 @@
(SLF4JBridgeHandler/removeHandlersForRootLogger)
(SLF4JBridgeHandler/install)

(when (try
(require 'figwheel.main.logging)
true
(catch Throwable _))
;; Undo default logger being extremely fine grained in figwheel,
;; in order to configure figwheel to delegate to slf4j.
(let [l @(resolve 'figwheel.main.logging/*logger*)]
((resolve 'figwheel.main.logging/remove-handlers) l)
(.setUseParentHandlers l true)))

(defmacro ^:private proxy-ns
[ns & vars]
(cons `do
Expand Down
6 changes: 6 additions & 0 deletions lib.logging.dev/src/logback.xml
Expand Up @@ -112,6 +112,12 @@
<appender-ref ref="APP_LOG_FILE" />
</logger>

<!-- figwheel puts some useful warnings through as INFO rather than WARN
See: https://github.com/bhauman/figwheel-main/issues/130
-->
<logger name="figwheel.logg" level="INFO">
<appender-ref ref="CONSOLE" />
</logger>

<!-- Make java.util.logging more efficient at disabled levels.
See http://logback.qos.ch/manual/configuration.html#LevelChangePropagator -->
Expand Down

0 comments on commit 3688e66

Please sign in to comment.