bhauman / figwheel-repl

Figwheel REPL provides a stable multiplexing REPL for ClojureScript
45 stars 11 forks source link

Using glog/warning instead of glog/warn #11

Closed stigi closed 4 years ago

stigi commented 4 years ago

This PR fixes a bug and compiler warning about the non existing goog.log/warn API.

The correct API to use is goog.log/warning.

Here's the log output again for reference:

[Figwheel:WARNING] Compile Warning   target/public/cljs-out/common/figwheel/repl.cljc   line:610  column:6

  Use of undeclared Var goog.log/warn

  605  (defn set-log-level [logger' level]
  606    (if-let [lvl (get log-levels level)]
  607      (do
  608        (.setLevel logger' lvl)
  609        (debug (str "setting log level to " level)))
  610      (glog/warn (str "Log level " (pr-str level) " doesn't exist must be one of "
            ^---
  611                      (pr-str '("severe" "warning" "info" "config" "fine" "finer" "finest"))))))
  612
  613  (defn init-log-level! []
  614    (doseq [logger' (cond-> [logger]
  615                      (exists? js/figwheel.core)

More details of this change have been discussed in #10 already.

Fixes #10

stigi commented 4 years ago

2 fixed the same issue in a different spot already 😀

I checked and this should be the last of its kind.

holtzermann17 commented 4 years ago

Nice simple one-line fix, would be nice to have this sorted @bhauman

bhauman commented 4 years ago

Thanks for this!