Add debug printing
This commit is contained in:
parent
aab2e4e442
commit
1e71ce1c35
1 changed files with 15 additions and 2 deletions
17
main.go
17
main.go
|
|
@ -5,6 +5,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"net/http/httputil"
|
||||||
"os"
|
"os"
|
||||||
"runtime/debug"
|
"runtime/debug"
|
||||||
|
|
||||||
|
|
@ -105,9 +106,21 @@ func (app *application) routes() http.Handler {
|
||||||
return standard.Then(mux)
|
return standard.Then(mux)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (app *application) stripe(w http.ResponseWriter, r *http.Request) {}
|
func (app *application) stripe(w http.ResponseWriter, r *http.Request) {
|
||||||
|
res, err := httputil.DumpRequest(r, true)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal(err)
|
||||||
|
}
|
||||||
|
fmt.Print("Stripe:", string(res))
|
||||||
|
}
|
||||||
|
|
||||||
func (app *application) paypal(w http.ResponseWriter, r *http.Request) {}
|
func (app *application) paypal(w http.ResponseWriter, r *http.Request) {
|
||||||
|
res, err := httputil.DumpRequest(r, true)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal(err)
|
||||||
|
}
|
||||||
|
fmt.Print("PayPal:", string(res))
|
||||||
|
}
|
||||||
|
|
||||||
// logRequest is a middleware that prints each request to the info log.
|
// logRequest is a middleware that prints each request to the info log.
|
||||||
func (app *application) logRequest(next http.Handler) http.Handler {
|
func (app *application) logRequest(next http.Handler) http.Handler {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue