As a visual learner, I’m always in search of ways to graphically represent my programs. Elixir has access to Erlang’s GUI process viewer called Observer, which displays a graphical tree of your program’s process hierarchy. The only issue is it’s not included out of the box with most Erlang installs. Apparently, this used to be a pretty tedious process on OS X, as googling yielded really complex processes to get it set up. I found with the current version of Erlang (19.0) and Mac OS (El Capitan), it’s actually pretty straightforward.
$ brew install wxmac
Then, make sure that your Erlang compile options include the
I use asdf to manage my Erlang install, so I needed to add the flag to this environment variable prior to installing Erlang.
ERLANG_CONFIGURE_OPTIONS="--enable-darwin-64bit --with-ssl=/usr/local/opt/openssl --with-wx"
If you use kerl, you would add the option to this variable:
Once you have Erlang compiled, you’re good to go - this feature bubbles right up te Elixir! You can fire up observer right from IEx:
iex> :observer.start :ok
Which will open up an amazing tool to explore you running application!