trptcolin / reply

REPL-y: A fitter, happier, more productive REPL for Clojure.
Eclipse Public License 1.0
337 stars 44 forks source link

Is there a way to get an nREPL message log? #210

Closed PEZ closed 1 year ago

PEZ commented 1 year ago

Hi! Thanks for providing REPL-y!

I'm debugging an nREPL related issue with Calva and use REPL-y for comparison when I want to remove Calva from the picture. In trying to figure out what REPL-y and Calva might be doing differently it would help a lot with a log of the nREPL messages sent and recieved from REPL-y. Is it possible to enable such a thing? And, if so, how do I do it?

trptcolin commented 1 year ago

It’s been a long time since I worked on this but I know there’s a concept of nrepl middleware at the nrepl server side - wonder if that could be helpful here? I don’t think there’s anything built in afaik, but I imagine for debugging purposes you could try tweaking https://github.com/trptcolin/reply/blob/main/src/clj/reply/eval_modes/nrepl.clj to add some println or something?

PEZ commented 1 year ago

Thanks! I'll have a look.

bbatsov commented 1 year ago

Experience has taught me that it's much easier to have this logging on the client side, than on the server. :-) See also https://github.com/nrepl/nrepl/issues/85 and https://github.com/lambdaisland/nrepl-proxy

PEZ commented 1 year ago

OMG. This in the announcements channel over at Clojurians slack an hour ago:

image
bbatsov commented 1 year ago

@PEZ Coincidence or providence? ;-) (see https://github.com/lambdaisland/nrepl-proxy/issues/1)

PEZ commented 1 year ago

Haha, I see what you did there.