   @debug_no_body "(no body)"
   @debug_stream "[Elixir.Stream]"
 
-  defp debug(request, {:ok, response}) do
+  defp debug(request, {:ok, response}, opts) do
     [
       "\n>>> REQUEST >>>\n",
       debug_query(request.query),
       ?\n,
-      debug_headers(request.headers),
+      debug_headers(request.headers, opts),
       ?\n,
       debug_body(request.body),
       ?\n,
       "\n<<< RESPONSE <<<\n",
-      debug_headers(response.headers),
+      debug_headers(response.headers, opts),
       ?\n,
       debug_body(response.body)
     ]
   end
 
-  defp debug(request, {:error, error}) do
+  defp debug(request, {:error, error}, opts) do
     [
       "\n>>> REQUEST >>>\n",
       debug_query(request.query),
       ?\n,
-      debug_headers(request.headers),
+      debug_headers(request.headers, opts),
       ?\n,
       debug_body(request.body),
       ?\n,

    |> Enum.map(fn {k, v} -> ["Query: ", to_string(k), ": ", to_string(v), ?\n] end)
  end

  defp debug_headers([]), do: @debug_no_headers
  defp debug_headers(headers), do: Enum.map(headers, fn {k, v} -> [k, ": ", v, ?\n] end)

  defp debug_body(nil), do: @debug_no_body
  defp debug_body([]), do: @debug_no_body

    Logger.log(level, fn -> Formatter.format(env, response, time, @format) end)

    if Keyword.get(@config, :debug, true) do
      Logger.debug(fn -> debug(env, response, opts) end)
    end

    response
