mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-02-01 01:41:21 -05:00
31 lines
605 B
Go
31 lines
605 B
Go
package svc
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"github.com/opencloud-eu/opencloud/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)
|
|
}
|
|
|
|
// GetThumbnail implements the Service interface.
|
|
func (l logging) GetThumbnail(w http.ResponseWriter, r *http.Request) {
|
|
l.next.GetThumbnail(w, r)
|
|
}
|