9
我尝试以下如何漂亮地打印连接内容?
def index(conn, _params) do
Logger.debug conn
......
,但我得到
protocol String.Chars not implemented for %Plug.Conn
我甚至尝试顶点,但没有任何工作。
我尝试以下如何漂亮地打印连接内容?
def index(conn, _params) do
Logger.debug conn
......
,但我得到
protocol String.Chars not implemented for %Plug.Conn
我甚至尝试顶点,但没有任何工作。
你应该能够使用Kernel.inspect/2靓打印conn
:
Logger.debug inspect(conn)
使用inspect conn, pretty: true
...或:
inspect conn, pretty: true, limit: 30000
...因为Conn
结构相当大的。
它会打印连接,但不幸的是结果并不美观...... –