2016-09-26 18:48:55 +00:00
|
|
|
package service
|
2016-09-01 04:51:38 +00:00
|
|
|
|
|
|
|
import (
|
|
|
|
kitlog "github.com/go-kit/kit/log"
|
2016-09-26 18:48:55 +00:00
|
|
|
"github.com/kolide/kolide-ose/server/kolide"
|
2016-09-01 04:51:38 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
// logging middleware logs the service actions
|
|
|
|
type loggingMiddleware struct {
|
|
|
|
kolide.Service
|
|
|
|
logger kitlog.Logger
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewLoggingService takes an existing service and adds a logging wrapper
|
|
|
|
func NewLoggingService(svc kolide.Service, logger kitlog.Logger) kolide.Service {
|
|
|
|
return loggingMiddleware{Service: svc, logger: logger}
|
|
|
|
}
|