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 (
"context"
"github.com/google/uuid"
"github.com/unistack-org/micro/v3/logger"
"github.com/unistack-org/micro/v3/registry"
)
@@ -19,10 +20,12 @@ type Options struct {
Network string
// Registry is the local registry
Registry registry.Registry
// Context for additional options
Context context.Context
// Precache routes
Precache bool
// Logger
Logger logger.Logger
// Context for additional options
Context context.Context
}
// Id sets Router Id
@@ -53,6 +56,13 @@ func Network(n string) Option {
}
}
// Logger sets the logger
func Logger(l logger.Logger) Option {
return func(o *Options) {
o.Logger = l
}
}
// Registry sets the local registry
func Registry(r registry.Registry) Option {
return func(o *Options) {