summaryrefslogtreecommitdiff
path: root/logging/middleware.go
diff options
context:
space:
mode:
Diffstat (limited to 'logging/middleware.go')
-rw-r--r--logging/middleware.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/logging/middleware.go b/logging/middleware.go
index 4e23c1e..3b68c15 100644
--- a/logging/middleware.go
+++ b/logging/middleware.go
@@ -6,12 +6,12 @@ import (
"io"
"time"
- "tildegit.org/tjp/gus"
+ sr "tildegit.org/tjp/sliderule"
)
-func LogRequests(logger Logger) gus.Middleware {
- return func(inner gus.Handler) gus.Handler {
- return gus.HandlerFunc(func(ctx context.Context, request *gus.Request) *gus.Response {
+func LogRequests(logger Logger) sr.Middleware {
+ return func(inner sr.Handler) sr.Handler {
+ return sr.HandlerFunc(func(ctx context.Context, request *sr.Request) *sr.Response {
response := inner.Handle(ctx, request)
if response != nil {
response.Body = loggingBody(logger, request, response)
@@ -23,8 +23,8 @@ func LogRequests(logger Logger) gus.Middleware {
}
type loggedResponseBody struct {
- request *gus.Request
- response *gus.Response
+ request *sr.Request
+ response *sr.Response
body io.Reader
start time.Time
@@ -81,7 +81,7 @@ func (lwtr loggedWriteToResponseBody) WriteTo(dst io.Writer) (int64, error) {
return n, err
}
-func loggingBody(logger Logger, request *gus.Request, response *gus.Response) io.Reader {
+func loggingBody(logger Logger, request *sr.Request, response *sr.Response) io.Reader {
body := &loggedResponseBody{
request: request,
response: response,