Where is the debug-toolbar?

Hi,

doesn’t Phoenix have a nice debug toolbar that shows what is going on in a nice frontend gui?

I am missing a good way to see exactkly what happened, which controllers where called, which database queries executed, ebnvironment variables, etc, the usual stuff you need for debugging. I can see lots of that stuff printed out in the console where I have a phoenix app running, but, well, that is not rally comfortable.

am i missing anything? Is there a phoenix-debug-toobar (could not find anything)?

Thanks!

2 Likes

Never seen one and don’t think it’s ever existed :slight_smile: Relatively easy to make your own, most information is kept in conn struct, but not sure where you can find information of executed queries for a particular connection call… I hope somebody can shed light on this topic here…

conn is quite informative, but e.g. the number of SQL queries is very important to see while development, this is not in conn and I do not understand (yet) ecto good enough to hack this together.

Also it would be good to have an officially supported infrastructure for this that could be extended, not havinig to maintain own snippets for each user.

How you inspect the conn in elixir repl?

Do you use some aliases? Some setup in .iex.exs ?

It would be very beneficial to us to know about how can one inspect conn on various stages of application!

I usually write IO.inspect conn in places where I want to check it. And then see what’s in conn in log :slight_smile:

1 Like

Iex.pry, :observer, and tracing and such are all very useful too. :slight_smile:

1 Like

:tada:

2 Likes

I’m curious, how do you track ecto queries? Does it only track queries made from the request processes or also from e.g. Task’s one did trigger?

ex_debug_toolbar currently tracks queries made from request process and preloads that run in separate processes (this requires master branch of elixir last time I checked). It can link preloads to request because they pass around caller_pid, which you can also do by passing it to Repo calls as an option. It’s not as convenient and we’re open to suggestions on how to deal with queries in separate processes.

This ex_debug_toolbar is cool, it should get it’s own thread. :slight_smile: