func CloseWithErrLogf(logger log.Logger, closer io.Closer, format string, a ...interface{}) {
	err := close(closer)
	if err == nil {
		return
	}
	if logger == nil {
		logger = log.NewLogfmtLogger(os.Stderr)
	}
	level.Warn(logger).Log("msg", "detected close error", "err", fmt.Errorf(format+", %w", append(a, err)...))
}
CloseWithErrLogf is making sure we log every error, even those from best effort tiny closers.
package internal
import (
	"errors"
	"fmt"
	"io"
	"os"
	"github.com/go-kit/kit/log"
	"github.com/go-kit/kit/log/level"
)