add logger to options

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
2020-08-29 17:44:49 +03:00
parent 2382446e10
commit 53654185ba
16 changed files with 239 additions and 48 deletions

View File

@@ -4,6 +4,8 @@ import (
"context"
"crypto/tls"
"time"
"github.com/unistack-org/micro/v3/logger"
)
type Options struct {
@@ -11,6 +13,7 @@ type Options struct {
Timeout time.Duration
Secure bool
TLSConfig *tls.Config
Logger logger.Logger
// Other options for implementations of the interface
// can be stored in a context
Context context.Context
@@ -74,6 +77,13 @@ func Secure(b bool) Option {
}
}
// Logger sets the logger
func Logger(l logger.Logger) Option {
return func(o *Options) {
o.Logger = l
}
}
// Specify TLS Config
func TLSConfig(t *tls.Config) Option {
return func(o *Options) {