Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions lib/plug/builder.ex
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,23 @@ defmodule Plug.Builder do
halt(conn)
end
end

## Debugging a pipeline

During development, you may wish to display the current state of the connection
at a certain point in the pipeline. This can be achieved by plugging the `dbg/2`
macro from Elixir. Since it accepts and returns the connection as first argument,
and takes options as the second, it just works:

defmodule PlugWithDbg do
use Plug.Builder

plug Plug.RewriteOn
plug :dbg
plug Plug.MethodOverride
plug :dbg, charlists: :as_lists
end

"""

@type plug :: module | atom
Expand Down