modify all code for never logger interface

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
2021-01-10 19:24:03 +03:00
parent 7b3a7a9448
commit 8b7380876e
16 changed files with 82 additions and 59 deletions

View File

@@ -7,13 +7,16 @@ import (
"net"
"os"
"github.com/unistack-org/micro/v3/api/server"
"github.com/unistack-org/micro/v3/api/server/acme"
"github.com/unistack-org/micro/v3/logger"
"golang.org/x/crypto/acme/autocert"
)
// autoCertACME is the ACME provider from golang.org/x/crypto/acme/autocert
type autocertProvider struct{}
type autocertProvider struct {
opts server.Options
}
func (a *autocertProvider) Init(opts ...acme.Option) error {
return nil
@@ -36,7 +39,7 @@ func (a *autocertProvider) TLSConfig(hosts ...string) (*tls.Config, error) {
dir := cacheDir()
if err := os.MkdirAll(dir, 0700); err != nil {
if logger.V(logger.InfoLevel) {
logger.Info("warning: autocert not using a cache: %v", err)
logger.Info(a.opts.Context, "warning: autocert not using a cache: %v", err)
}
} else {
m.Cache = autocert.DirCache(dir)