This is a general discussion for how to use Elixir tooling better for development. (OTP or Phoenix projects)
Currently, I and my friend use IO.inspect everywhere in our app to debug what is not working.
We have a nice ColorIO module which enables us to IO.inspect in different colors.
This is one approach to development we learnt while being in JS and Python ecosystem. Just log everything to terminal.
What are other ways people develop / debug their apps?
Are there some good Elixir tools for debugging?
Any other questions that people want to discuss, I will put them here after editing.
Thanks!
(since Elixir 1.13 mentions a lot of tooling and behind the scenes changes, I wonder if I am yet unaware of some awesome tool.)
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.