Sometimes tracing is more informative than manual IO.inspect
- GitHub - nietaki/rexbug: A thin Elixir wrapper for the redbug Erlang tracing debugger.
- GitHub - ferd/recon: Collection of functions and scripts to debug Erlang in production.
In tests I start tracing before the failing function is called:
test "some curious failure" do
Rexbug.start("Schrodingbug :: return", msgs: 30)
refute Schrodingbug.maybe_fail()
end
In dev I can run it before execution some function in UI / API request, like before logging in:
iex> Rexbug.start("Accounts :: return", msgs: 100, time: 10000)
# ... starts printing out traces of the function executed in the login flow
# ... gives a better understanding of how things fit together
Best of all it works in prod, but that use-case is already described in the project descriptions above.