如何漂亮地打印conn内容? [英] How to pretty print conn content?

查看:88
本文介绍了如何漂亮地打印conn内容?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试了以下

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

但是我明白了

protocol String.Chars not implemented for %Plug.Conn

我什至尝试过Apex,但这也不起作用.

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

推荐答案

您应该可以使用

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

Logger.debug inspect(conn)

这篇关于如何漂亮地打印conn内容?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆