mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-01-05 11:51:16 -06:00
41 lines
857 B
Go
41 lines
857 B
Go
package svc
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"github.com/owncloud/ocis/ocis-pkg/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)
|
|
}
|
|
|
|
// GetMe implements the Service interface.
|
|
func (l logging) GetMe(w http.ResponseWriter, r *http.Request) {
|
|
l.next.GetMe(w, r)
|
|
}
|
|
|
|
// GetUsers implements the Service interface.
|
|
func (l logging) GetUsers(w http.ResponseWriter, r *http.Request) {
|
|
l.next.GetUsers(w, r)
|
|
}
|
|
|
|
// GetUser implements the Service interface.
|
|
func (l logging) GetUser(w http.ResponseWriter, r *http.Request) {
|
|
l.next.GetUser(w, r)
|
|
}
|