Easier way to debug?


Hi Eric - was wondering if there was a recommended way to debug. Specifically I’m looking for something similar to that rails function where I can dump both the Request and the Response somewhere (end of every web page, to a file, etc.)

I tried writing an extra handler/wrapper (gist below) but the requests seem to get oddly garbled:

{{:status:status  304304, , :headers :headers {"{Server"" "SDeartvoemri"c kev"", Da"tCoomnitceknetv"-T, ype" "C"otnetxetn/tc-sTsy"p, e" ""Ltaesxtt-/Mjoadviafsicerdipt"",  ""TLhaus,t -1M3o dFiefbi e2d0"1 4 1"7T:h2u4,: 4123  +F0e0b0 02"0, 14 17":C2o4n:t4e2n t+-0L0e0n0g"t, h" ""C0o"nt}ent, -Lengt:bodyh " """}0"}, :body ""}

The gist is here:


Hey there.

It looks like two things are getting printed in parallel, so the characters are interleaved.

My suggestion is to use a log system, such as timbre.

It requires a little setup, but it solves exactly this problem.

You could do it yourself using an Agent. Also, you may want to keep your request and response together so you can relate them back. Here’s a gist to do that.