TwistingTwists
Approach to development in Elixir - Utilising Elixir tools better
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.)
Most Liked
ruslandoga
Sometimes tracing is more informative than manual IO.inspect
- GitHub - nietaki/rexbug: A thin Elixir wrapper for the redbug Erlang tracing debugger. · GitHub
- GitHub - ferd/recon: Collection of functions and scripts to debug Erlang in production. · GitHub
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.
Last Post!
Popular in Discussions
Other popular topics
Chat & Discussions>Discussions
Latest on Elixir Forum
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #elixirconf-us
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #security
- #hex










