I send a task to an agent, but can't see the output of any print statements I've put into the function. How do I trace code execution on agents?
EDIT: Turns out I do get the output in the console, but not in SLIME. The question now is, how to see the output in SLIME?
The key is to start swank from emacs as the inferior lisp process instead of calling lein swank from the shell. One way to do this is to use elein (the command is M-x elein-swank
). Then you can either inspect the output in the inferior lisp buffer (which is called *elein-swank*
in the example of using elein), or execute slime-redirect-inferior-output
and have the output inline in the repl. Clojure.contrib.logging is a useful tool for sending log output.
You could wrap the calls in your repl in (with-out-str (def result (my-code)))
to capture the output as a string. this way you can do it for just the code you're working on and you dont have to restart your repl to start getting your output.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With