1
// Copyright 2014 Canonical Ltd.
2
// Licensed under the AGPLv3, see LICENCE file for details.
4
// The debug package holds various functions that may
5
// be used for debugging but should not be included
7
package debug // import "gopkg.in/juju/charmstore.v5-unstable/internal/debug"
14
// Handler returns a new handler that wraps h
15
// and logs the given message with the URL path
16
// every time the request is invoked.
17
func Handler(msg string, h http.Handler) http.Handler {
18
return http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
19
log.Printf("%s got request at URL %q; headers %q", msg, req.URL, req.Header)