Approach to development in Elixir - Utilising Elixir tools better

Sometimes tracing is more informative than manual IO.inspect

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.

4 Likes