Looking at the state of processes in Elixir
When debugging gen_server, gen_statem and gen_event processes it can be helpful to take a look at the state.
Its easy to do this in Elixir by calling out to Erlangs sys.get_state/1
:
iex(1)> defmodule Example, do: use GenServer
iex(2)> {:ok, pid} = GenServer.start_link(Example, %{ping: "pong"})
iex(3)> :sys.get_state(pid)
%{ping: "pong"}
For more common sys
debugging functions, take a look here