The key to using sayid to capture curl requests is having emacs/cider 
connected to the same jvm instance that is running the web server. I did 
this by starting a repl with `lein repl`, then calling the -main function, 
which started the web server. From there, I used sayid to trace namespaces 
and finally, I made a request to the web server with curl. I may not be 
including the right details here. Let me know if you still have questions.



On Wednesday, January 11, 2017 at 3:32:31 PM UTC-5, ahawk wrote:
>
> Thanks a lot for your reply.
>
> I saw the video of your presentation and it seems like your tool is 
> exactly what I am looking for. I've actually installed the package in Emacs 
> and configured the Emacs/CIDER integration, but I haven't gotten to try it 
> thoroughly just yet.
>
> In your video, you demonstrate using sayid to debug curl requests, but it 
> is unclear to me how you make this happen. If you have the time, please 
> elaborate. It would be very helpful to me to be able to log http requests 
> originating from curl or a browser.
>
> Den mandag den 9. januar 2017 kl. 13.24.26 UTC+1 skrev Bill Piel:
>>
>> ahawk,
>>
>> I've been using clojure for years, but can still relate to the issues you 
>> are facing, which is why I wrote a debugging/development tool to help. It's 
>> called sayid. It can be used directly from the repl, but has an emacs/cider 
>> integration that makes it much more powerful. 
>>
>> http://bpiel.github.io/sayid/
>>
>> In a nutshell, sayid will let you capture all the args and return values 
>> from functions as they are executed -- then allow you to inspect, query and 
>> visualize them. The project is still in alpha and not thoroughly 
>> documented, so if you do decide to try it out and run into any issues, 
>> PLEASE get in touch by filing an issue or even emailing me. My address is 
>> on my github profile.
>>
>> https://github.com/bpiel
>>
>> Also, I presented it at the last Conj conference in Austin.  
>> https://www.youtube.com/watch?v=ipDhvd1NsmE
>>
>>
>>
>>
>>
>>
>>
>>
>> On Sunday, January 8, 2017 at 11:06:34 AM UTC-5, Matching Socks wrote:
>>>
>>> That is an ambitious project.  Divide and conquer.  One super duper 
>>> benefit of Clojure is that if you make a web app with, say, just Ring and 
>>> Compojure, you can later transplant that work into a more elaborate app 
>>> scaffolding, because it's all just plain maps.
>>>
>>> "quite a lot of map manipulation going on with the request and response 
>>> maps"
>>>
>>> On the bright side, map manipulation is *all* that is going on.  There 
>>> are no side effects.  Therefore, it can be very helpful to log the request 
>>> and response maps.  For example, make a Ring handler that does nothing but 
>>> log the request, delegate to the next handler, log its response, and return 
>>> its response; then stick that handler wherever in the handler stack makes 
>>> you curious.  Using the Emacs CIDER REPL you may change the handler stack 
>>> and fiddle with logging while the program runs, so logging is a convenient 
>>> debugging technique.
>>>
>>> "unless, of course, I read and understand their source"
>>>
>>> On the bright side again, there is not much source code there, at least 
>>> compared with what you'd expect in Java.  Also, the jar that Maven (etc) 
>>> can fetch for you *is* the source code, and Emacs can open such jars and 
>>> browse the files inside.  
>>>
>>> Some of the libraries have overview documentation that puts the API docs 
>>> in context.  Keep the Ring SPEC open, and the Liberator graph too if you 
>>> can figure out how to view more than a tiny bit of it.
>>>
>>> By all means point out gaps in the docs on the libraries' respective 
>>> issue trackers.
>>>
>>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to