We can't find the internet
Attempting to reconnect
Something went wrong!
Hang in there while we get back on track
Limiting IO.inspect/2 output
almirsarajcic
Created
Are you using the function IO.inspect/2
for debugging? Are you getting overwhelmed with the outputs of large structs?
Try passing the :limit
option. It limits the number of items shown for any collection.
{:ok,
socket
# some assigns
# ...
|> IO.inspect(label: "socket", limit: 5)}
# prints
socket: #Phoenix.LiveView.Socket<
id: "phx-GA-FuxsBgRdd1gOm",
endpoint: ElixirDropsWeb.Endpoint,
view: ElixirDropsWeb.DropLive.Index,
parent_pid: nil,
root_pid: nil,
...
>
# instead of a huge Phoenix.LiveView.Socket struct
Check other IO.inspect/2
options: https://hexdocs.pm/elixir/Inspect.Opts.html.
Copy link
copied to clipboard