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,7 @@ import (
"time"
"github.com/google/uuid"
"github.com/unistack-org/micro/v3/logger"
"github.com/unistack-org/micro/v3/transport"
)
@@ -28,6 +29,8 @@ type Options struct {
Token string
// Transport listens to incoming connections
Transport transport.Transport
// Logger
Logger logger.Logger
}
type DialOption func(*DialOptions)
@@ -59,6 +62,13 @@ func Id(id string) Option {
}
}
// Logger sets the logger
func Logger(l logger.Logger) Option {
return func(o *Options) {
o.Logger = l
}
}
// The tunnel address
func Address(a string) Option {
return func(o *Options) {