improve gopher request logging

Signed-off-by: kim (grufwub) <grufwub@gmail.com>
development
kim (grufwub) 4 years ago
parent 52a75eacec
commit 549aa31158

@ -6,6 +6,11 @@ type Request struct {
params string
}
// String returns the full parsed request string (mainly for logging)
func (r *Request) String() string {
return r.p.Relative() + "?" + r.params
}
// Path returns the requests associate Path object
func (r *Request) Path() *Path {
return r.p

@ -100,9 +100,9 @@ func serve(client *core.Client) {
// Final error handling
if err != nil {
handleError(client, err)
client.LogError(clientServeFailStr, request.Path().Absolute())
client.LogError(clientServeFailStr, request.String())
} else {
client.LogInfo(clientServedStr, request.Path().Absolute())
client.LogInfo(clientServedStr, request.String())
}
}

Loading…
Cancel
Save