Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to pretty print conn content?

I tried the following

def index(conn, _params) do
    Logger.debug conn
     ......

But I get

protocol String.Chars not implemented for %Plug.Conn

I even tried Apex but that didn't worked either.

like image 697
rogergl Avatar asked Oct 05 '15 17:10

rogergl


2 Answers

Use inspect conn, pretty: true

... or:

inspect conn, pretty: true, limit: 30000

... since Conn structures are pretty big.

like image 196
Brian Marick Avatar answered Oct 10 '22 21:10

Brian Marick


You should be able to use Kernel.inspect/2 to pretty print conn:

Logger.debug inspect(conn)
like image 28
Patrick Oscity Avatar answered Oct 10 '22 21:10

Patrick Oscity