         (cors/wrap-cors
          :access-control-allow-origin #".*"
          :access-control-allow-methods [:head :options :get :put :post :delete :patch])
+        (log-output-to-figwheel-server-log log-writer)
         (run-server (let [config {:port server-port :worker-name-prefix "figwh-httpkit-"}]
                       (if server-ip
                         (assoc config :ip server-ip)

    (with-channel request channel
      (setup-file-change-sender server-state (:params request) channel))))

(defn server
  "This is the server. It is complected and its OK. Its trying to be a basic devel server and
   also provides the figwheel websocket connection."
  [{:keys [server-port server-ip http-server-root resolved-ring-handler] :as server-state}]
  (try
    (-> (routes
         (GET "/figwheel-ws/:desired-build-id" {params :params} (reload-handler server-state))

   [clojure.java.io :as io]
   [clojure.java.shell :as shell]
   [clojure.edn :as edn]
   [clojure.stacktrace :as stack]
   [clojure.core.async :refer [go-loop <!! <! timeout]]

   [compojure.route :as route]
