mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-01-06 04:09:40 -06:00
31 lines
581 B
Go
31 lines
581 B
Go
package svc
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"github.com/owncloud/ocis-pkg/v2/log"
|
|
)
|
|
|
|
// NewLogging returns a service that logs messages.
|
|
func NewLogging(next Service, logger log.Logger) Service {
|
|
return logging{
|
|
next: next,
|
|
logger: logger,
|
|
}
|
|
}
|
|
|
|
type logging struct {
|
|
next Service
|
|
logger log.Logger
|
|
}
|
|
|
|
// ServeHTTP implements the Service interface.
|
|
func (l logging) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
|
l.next.ServeHTTP(w, r)
|
|
}
|
|
|
|
// Config implements the Service interface.
|
|
func (l logging) Config(w http.ResponseWriter, r *http.Request) {
|
|
l.next.Config(w, r)
|
|
}
|