We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
dbg/2
1 parent 8723880 commit a0e274bCopy full SHA for a0e274b
lib/plug/builder.ex
@@ -123,6 +123,23 @@ defmodule Plug.Builder do
123
halt(conn)
124
end
125
126
+
127
+ ## Debugging a pipeline
128
129
+ During development, you may wish to display the current state of the connection
130
+ at a certain point in the pipeline. This can be achieved by plugging the `dbg/2`
131
+ macro from Elixir. Since it accepts and returns the connection as first argument,
132
+ and takes options as the second, it just works:
133
134
+ defmodule PlugWithDbg do
135
+ use Plug.Builder
136
137
+ plug Plug.RewriteOn
138
+ plug :dbg
139
+ plug Plug.MethodOverride
140
+ plug :dbg, charlists: :as_lists
141
+ end
142
143
"""
144
145
@type plug :: module | atom
0 commit comments