You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: http_logger_middleware.go
    path of file: ./repos/grafana/pkg/infra/httpclient/httpclientprovider
    
    the code of the file until where you have to start completion: package httpclientprovider

import (
	"net/http"

	sdkhttpclient "github.com/grafana/grafana-plugin-sdk-go/backend/httpclient"
	httplogger "github.com/grafana/grafana-plugin-sdk-go/experimental/http_logger"
	"github.com/grafana/grafana/pkg/setting"
)

const HTTPLoggerMiddlewareName = "http-logger"

func HTTPLogger
    
func HTTPLoggerMiddleware(cfg setting.PluginSettings) sdkhttpclient.Middleware {
	return sdkhttpclient.NamedMiddlewareFunc(HTTPLoggerMiddlewareName, func(opts sdkhttpclient.Options, next http.RoundTripper) http.RoundTripper {
		datasourceType, exists := opts.Labels["datasource_type"]
		if !exists {
			return next
		}

		enabled, path := getLoggerSettings(datasourceType, cfg)
		if !enabled {
			return next
		}

		return httplogger.NewHTTPLogger(datasourceType, next, httplogger.Options{
			Path:      path,
			EnabledFn: func() bool { return true },
		})
	})
}