8
(defn app [request]
  (println "test")
  {:body "Hello World"})

(defonce server (run-jetty #'app {:port 8080 :join? false}))

println doesn't seem to work in a handler. How do I write to the REPL window?

I'm using eclipse with counterclockwise.

EDIT: This looks like nrepl issue. (future (println "foo")) is fine, but no output with (.start (Thread. #(println "foo"))).

alice
  • 2,547
  • 4
  • 24
  • 30

2 Answers2

6

println doesn't write to output directly, rather it buffers the output and flush it later. You can try (.println System/out "test")

Ankur
  • 33,367
  • 2
  • 46
  • 72
2

You can find the outputin the *nrepl-server ...* buffer for your project. In CIDER, this buffer is hidden. You can find it with C-x C-b though.

Lispnik
  • 709
  • 5
  • 7